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

Better pre-scan size estimations for objects in the JSON parser resulting

in fewer reallocations and memmove operations.

FossilOrigin-Name: 526b27f90897f5e35dfff7257daf6c4ce4798d649b09b8aecfb02df0449e3c51
This commit is contained in:
drh
2023-12-04 01:14:23 +00:00
parent b7fd951be4
commit 2ff73a5f3e
3 changed files with 8 additions and 8 deletions

View File

@@ -1268,7 +1268,7 @@ json_parse_restart:
case '{': {
/* Parse object */
iThis = pParse->nBlob;
jsonBlobAppendNode(pParse, JSONB_OBJECT, (pParse->nJson-i)*2, 0);
jsonBlobAppendNode(pParse, JSONB_OBJECT, pParse->nJson-i, 0);
if( ++pParse->iDepth > JSON_MAX_DEPTH ){
pParse->iErr = i;
return -1;