diff options
author | René Scharfe <l.s.r@web.de> | 2020-02-22 21:51:13 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-24 20:30:29 +0300 |
commit | 2b3c430bcea5d8c40b218c7e2a71d261822c6a52 (patch) | |
tree | 82d75d9700fa46318f609e0a63eb2d6987cc2411 /quote.c | |
parent | d0654dc308b0ba76dd8ed7bbb33c8d8f7aacd783 (diff) |
quote: use isalnum() to check for alphanumeric characters
isalnum(c) is equivalent to isalpha(c) || isdigit(c), so use the
former instead. The result is shorter, simpler and slightly more
efficient.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'quote.c')
-rw-r--r-- | quote.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -55,7 +55,7 @@ void sq_quote_buf_pretty(struct strbuf *dst, const char *src) } for (p = src; *p; p++) { - if (!isalpha(*p) && !isdigit(*p) && !strchr(ok_punct, *p)) { + if (!isalnum(*p) && !strchr(ok_punct, *p)) { sq_quote_buf(dst, src); return; } |