aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/json1.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-09-24 01:40:45 +0000
committerdrh <drh@noemail.net>2015-09-24 01:40:45 +0000
commit8cb15cc5ae65aa9f0a3bda7752e12e6a9c70e066 (patch)
treeede81e9db96ba2875cc39d02d8e1f03ba6ba7722 /ext/misc/json1.c
parent9567794fd931511bff5bcff1fe4c2749a28b65a4 (diff)
downloadsqlite-8cb15cc5ae65aa9f0a3bda7752e12e6a9c70e066.tar.gz
sqlite-8cb15cc5ae65aa9f0a3bda7752e12e6a9c70e066.zip
Another (smaller) performance optimization for the JSON parser.
FossilOrigin-Name: c43daa8c78df99f62dd4d3c83708a3a8eff92496
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r--ext/misc/json1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/misc/json1.c b/ext/misc/json1.c
index cf766120c..89b70f083 100644
--- a/ext/misc/json1.c
+++ b/ext/misc/json1.c
@@ -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 */
}