1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Back off on the use of strlen() for situations where sqlite3_value_bytes()

will work as well, for performance.

FossilOrigin-Name: 79fb54fbb8b9c30f47cdbd437d24a21542716241e822749e5e28c9fbc449bfa8
This commit is contained in:
drh
2023-12-04 00:31:58 +00:00
parent 9af45dc482
commit b7fd951be4
3 changed files with 9 additions and 9 deletions

View File

@@ -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]);