1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Another (smaller) performance optimization for the JSON parser.

FossilOrigin-Name: c43daa8c78df99f62dd4d3c83708a3a8eff92496
This commit is contained in:
drh
2015-09-24 01:40:45 +00:00
parent 9567794fd9
commit 8cb15cc5ae
3 changed files with 10 additions and 9 deletions

View File

@ -649,8 +649,7 @@ static int jsonParseValue(JsonParse *pParse, u32 i){
int x;
JsonNode *pNode;
while( safe_isspace(pParse->zJson[i]) ){ i++; }
if( (c = pParse->zJson[i])==0 ) return 0;
if( c=='{' ){
if( (c = pParse->zJson[i])=='{' ){
/* Parse object */
iThis = jsonParseAddNode(pParse, JSON_OBJECT, 0, 0);
if( iThis<0 ) return -1;
@ -770,6 +769,8 @@ static int jsonParseValue(JsonParse *pParse, u32 i){
return -2; /* End of {...} */
}else if( c==']' ){
return -3; /* End of [...] */
}else if( c==0 ){
return 0; /* End of file */
}else{
return -1; /* Syntax error */
}

View File

@ -1,5 +1,5 @@
C Performance\soptimizations\son\sthe\sJSON\sparser.
D 2015-09-24T01:06:37.957
C Another\s(smaller)\sperformance\soptimization\sfor\sthe\sJSON\sparser.
D 2015-09-24T01:40:45.848
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in e1afa6fb2de2bddd50e0ddae8166c2ee9d69b301
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -195,7 +195,7 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c 4c84635c71c26cfa7c2e5848cf49fe2d2cfcd767
F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
F ext/misc/json1.c 7d0000e380785587d463087aa9b35969727bd441
F ext/misc/json1.c 557d6b2d0c3d26625e686a4b4ef8d4a50b8cec94
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
@ -1388,7 +1388,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 5b61b72f5424a2d9bb4e68eb95026cd63f003db9
R 573d7fd2b2ba49c88643e63838f29bfa
P 7dd4b07a42eb84589d34430b9d7bfa88fbd743eb
R 35931ccc4bad18cd2e2cb0703934d351
U drh
Z e6052053910d25a8548d981b3aa4b989
Z 66f4794fa30512464c1e57a2a59bf55d

View File

@ -1 +1 @@
7dd4b07a42eb84589d34430b9d7bfa88fbd743eb
c43daa8c78df99f62dd4d3c83708a3a8eff92496