optimize whitespace checking for gcc optimization - json2tsv - JSON to TSV conv… | |
git clone git://git.codemadness.org/json2tsv | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit b780768500f3466bea0d2f770fc379eb9cb78669 | |
parent e49c809209014c1ab4e7c6b0921d82a5cbae5feb | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Wed, 23 Oct 2019 21:39:49 +0200 | |
optimize whitespace checking for gcc optimization | |
Restores some performance. no difference for clang. | |
gcc 4.2.1 | |
clang 8.0.1 | |
Diffstat: | |
M json.c | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
--- | |
diff --git a/json.c b/json.c | |
@@ -109,7 +109,7 @@ handlechr: | |
break; | |
/* skip JSON white-space, (NOTE: no \v, \f, \b etc) */ | |
- if (c && strchr(" \t\n\r", c)) | |
+ if (c == ' ' || c == '\t' || c == '\n' || c == '\r') | |
continue; | |
if (!c || !strchr(expect, c)) |