diff options
author | Alex Riesen <raa.lkml@gmail.com> | 2007-12-03 20:11:43 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-04 15:50:18 -0800 |
commit | f64c81d4282b1dacf2cf095bfb0f7708b99b3ecf (patch) | |
tree | afb82dc12e5b01a4c282108e9f34fd4b0cd19f4f /ident.c | |
parent | 5188408057b31a604f00496582aa873054ad6746 (diff) | |
download | git-f64c81d4282b1dacf2cf095bfb0f7708b99b3ecf.tar.gz |
Simplify crud() in ident.c
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ident.c')
-rw-r--r-- | ident.c | 28 |
1 files changed, 9 insertions, 19 deletions
@@ -113,25 +113,15 @@ static int add_raw(char *buf, size_t size, int offset, const char *str) static int crud(unsigned char c) { - static char crud_array[256]; - static int crud_array_initialized = 0; - - if (!crud_array_initialized) { - int k; - - for (k = 0; k <= 31; ++k) crud_array[k] = 1; - crud_array[' '] = 1; - crud_array['.'] = 1; - crud_array[','] = 1; - crud_array[':'] = 1; - crud_array[';'] = 1; - crud_array['<'] = 1; - crud_array['>'] = 1; - crud_array['"'] = 1; - crud_array['\''] = 1; - crud_array_initialized = 1; - } - return crud_array[c]; + return c <= 32 || + c == '.' || + c == ',' || + c == ':' || + c == ';' || + c == '<' || + c == '>' || + c == '"' || + c == '\''; } /* |