1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Small performance gain by unwinding the string literal delimiter search

loop in the JSON parser by one more level.

FossilOrigin-Name: 4c587feac153e8ebe526559ec3d254f545f81e8d1ed3126f91a5ff25ec4aa72e
This commit is contained in:
drh
2023-12-05 12:22:05 +00:00
parent 78f7d2f4c1
commit 590aaff992
3 changed files with 13 additions and 11 deletions

View File

@@ -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]] ){
j += 2;
continue;
}else{
if( !jsonIsOk[(u8)z[j+1]] ){
j += 1;
}else if( !jsonIsOk[(u8)z[j+2]] ){
j += 2;
}else{
j += 3;
continue;
}
}
c = z[j];