diff options
author | drh <> | 2023-12-04 00:31:58 +0000 |
---|---|---|
committer | drh <> | 2023-12-04 00:31:58 +0000 |
commit | b7fd951be4b5ca926c8daa787d5a627c3772df3e (patch) | |
tree | d7f26472d5f06d91e152610b403eaa11a88a042b /src | |
parent | 9af45dc4826dd6acb24b11759346bf43a3cf4503 (diff) | |
download | sqlite-b7fd951be4b5ca926c8daa787d5a627c3772df3e.tar.gz sqlite-b7fd951be4b5ca926c8daa787d5a627c3772df3e.zip |
Back off on the use of strlen() for situations where sqlite3_value_bytes()
will work as well, for performance.
FossilOrigin-Name: 79fb54fbb8b9c30f47cdbd437d24a21542716241e822749e5e28c9fbc449bfa8
Diffstat (limited to 'src')
-rw-r--r-- | src/json.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/json.c b/src/json.c index 1e88b5174..f5eef834d 100644 --- a/src/json.c +++ b/src/json.c @@ -3579,7 +3579,7 @@ static void jsonObjectFunc( } jsonAppendSeparator(&jx); z = (const char*)sqlite3_value_text(argv[i]); - n = z!=0 ? sqlite3Strlen30(z) : 0; + n = sqlite3_value_bytes(argv[i]); jsonAppendString(&jx, z, n); jsonAppendChar(&jx, ':'); jsonAppendSqlValue(&jx, argv[i+1]); @@ -4099,7 +4099,7 @@ static void jsonObjectStep( } pStr->pCtx = ctx; z = (const char*)sqlite3_value_text(argv[0]); - n = z ? sqlite3Strlen30(z) : 0; + n = sqlite3Strlen30(z); jsonAppendString(pStr, z, n); jsonAppendChar(pStr, ':'); jsonAppendSqlValue(pStr, argv[1]); |