diff options
author | drh <> | 2023-12-05 12:22:05 +0000 |
---|---|---|
committer | drh <> | 2023-12-05 12:22:05 +0000 |
commit | 590aaff9928d7904e16f9868f1822beaeab6d909 (patch) | |
tree | 55dc7d1240ddee2b885c816321530e50ca12c16e /src/json.c | |
parent | 78f7d2f4c10547a3bbb0a41fca6d9e540a9c4623 (diff) | |
download | sqlite-590aaff9928d7904e16f9868f1822beaeab6d909.tar.gz sqlite-590aaff9928d7904e16f9868f1822beaeab6d909.zip |
Small performance gain by unwinding the string literal delimiter search
loop in the JSON parser by one more level.
FossilOrigin-Name: 4c587feac153e8ebe526559ec3d254f545f81e8d1ed3126f91a5ff25ec4aa72e
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/json.c b/src/json.c index 7bb409a8e..ff488de4e 100644 --- a/src/json.c +++ b/src/json.c @@ -1412,11 +1412,13 @@ json_parse_restart: j = i+1; while( 1 /*exit-by-break*/ ){ if( jsonIsOk[(u8)z[j]] ){ - if( jsonIsOk[(u8)z[j+1]] ){ + if( !jsonIsOk[(u8)z[j+1]] ){ + j += 1; + }else if( !jsonIsOk[(u8)z[j+2]] ){ j += 2; - continue; }else{ - j += 1; + j += 3; + continue; } } c = z[j]; |