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

Avoid an unnecessary call to strlen() in the sqlite3VdbeMemStringify() routine,

for a performance increase and size reduction.

FossilOrigin-Name: 284382d37850f469dc4bf3ab8efd2f20971554e897f1ba3e94d3f2f0c35d97d0
This commit is contained in:
drh
2023-01-03 18:51:18 +00:00
parent 1eb88d6e5a
commit fbde3f50bf
5 changed files with 23 additions and 16 deletions

View File

@@ -632,11 +632,14 @@ do_atof_calc:
#endif
/*
** Render an signed 64-bit integer as text. Store the result in zOut[].
** Render an signed 64-bit integer as text. Store the result in zOut[] and
** return the length of the string that was stored, in bytes. The value
** returned does not include the zero terminator at the end of the output
** string.
**
** The caller must ensure that zOut[] is at least 21 bytes in size.
*/
void sqlite3Int64ToText(i64 v, char *zOut){
int sqlite3Int64ToText(i64 v, char *zOut){
int i;
u64 x;
char zTemp[22];
@@ -653,6 +656,7 @@ void sqlite3Int64ToText(i64 v, char *zOut){
}while( x );
if( v<0 ) zTemp[i--] = '-';
memcpy(zOut, &zTemp[i+1], sizeof(zTemp)-1-i);
return sizeof(zTemp)-2-i;
}
/*