Optimize example/jsonptr string conversion

On a mid-range x86_64 laptop, processing the 181 MiB citylots.json file
from github.com/zemirco/sf-city-lots-json:

$ time gen/bin/example-jsonptr < citylots.json > /dev/null
Before this commit:
real    0m1.687s
After:
real    0m1.677s
Ratio: 1.01x
This commit is contained in:
Nigel Tao committed 2020-08-21 15:57:51 +10:00
1 parent 3f688b2677
commit ade016523b
1 file changed
+1 -6
+1 -6
View File
@@ -1199,14 +1199,9 @@ handle_token(wuffs_base__token t, bool start_of_token_chain) {
g_query.is_at(g_depth));
}
if (vbd & WUFFS_BASE__TOKEN__VBD__STRING__CONVERT_0_DST_1_SRC_DROP) {
// No-op.
} else if (vbd &
WUFFS_BASE__TOKEN__VBD__STRING__CONVERT_1_DST_1_SRC_COPY) {
if (vbd & WUFFS_BASE__TOKEN__VBD__STRING__CONVERT_1_DST_1_SRC_COPY) {
TRY(write_dst(tok.ptr, tok.len));
g_query.incremental_match_slice(tok.ptr, tok.len);
} else {
return "main: internal error: unexpected string-token conversion";
}
if (t.continued()) {