From 42735c7d302dadc356f6e5ed7692e3e223b0a9ba Mon Sep 17 00:00:00 2001 From: drh Date: Thu, 29 Sep 2016 19:27:16 +0000 Subject: [PATCH] Size and performance optimization to sqlite3ValueFromExpr() FossilOrigin-Name: 945f82bc44c5a431c0fef0d36cf016671d7ade1e --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbemem.c | 7 ++----- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 6db27f934a..2a85770633 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Clarification\sand\stypo-fixes\sin\scomments.\s\sNo\schanges\sto\scode. -D 2016-09-29T15:53:28.199 +C Size\sand\sperformance\soptimization\sto\ssqlite3ValueFromExpr() +D 2016-09-29T19:27:16.222 F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 5151cc64c4c05f3455f4f692ad11410a810d937f @@ -459,7 +459,7 @@ F src/vdbeInt.h 581b737c2f6e413c555469480efe31796a71bcad F src/vdbeapi.c 794f80669e9e3b9b3edc78d80c15968985c7bf21 F src/vdbeaux.c b9772e4134a17f5b42d32761f5119467815c2458 F src/vdbeblob.c 3e82a797b60c3b9fed7b8de8c539ca7607874937 -F src/vdbemem.c 07874c2ac7c05f7df1ededc6ec6650c1339b2cad +F src/vdbemem.c 1b8d5b770a9a3c6d8ed3463104a382bffa6f15c2 F src/vdbesort.c 91fda3909326860382b0ca8aa251e609c6a9d62c F src/vdbetrace.c 41963d5376f0349842b5fc4aaaaacd7d9cdc0834 F src/vtab.c e02cacb5c7ae742631edeb9ae9f53d399f093fd8 @@ -1525,7 +1525,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P cc29ddd6be60bdbf107f285c9eb57d5896ebca2d -R 647685f38d2c1b34b7290eda763c0ba3 +P e2cd79aa3104c51035bf29c548c322564731b75f +R ced10222d4b6fcbb24f085bf78455885 U drh -Z 99ca7352da532b6b28eade6076b7309c +Z 527ba3ca85dfce0ba6019f348119d7e0 diff --git a/manifest.uuid b/manifest.uuid index f79940d5cf..098948e590 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e2cd79aa3104c51035bf29c548c322564731b75f \ No newline at end of file +945f82bc44c5a431c0fef0d36cf016671d7ade1e \ No newline at end of file diff --git a/src/vdbemem.c b/src/vdbemem.c index b03aa49702..fb4f704f5d 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -1269,10 +1269,7 @@ static int valueFromExpr( const char *zNeg = ""; int rc = SQLITE_OK; - if( !pExpr ){ - *ppVal = 0; - return SQLITE_OK; - } + assert( pExpr!=0 ); while( (op = pExpr->op)==TK_UPLUS || op==TK_SPAN ) pExpr = pExpr->pLeft; if( NEVER(op==TK_REGISTER) ) op = pExpr->op2; @@ -1396,7 +1393,7 @@ int sqlite3ValueFromExpr( u8 affinity, /* Affinity to use */ sqlite3_value **ppVal /* Write the new value here */ ){ - return valueFromExpr(db, pExpr, enc, affinity, ppVal, 0); + return pExpr ? valueFromExpr(db, pExpr, enc, affinity, ppVal, 0) : 0; } #ifdef SQLITE_ENABLE_STAT3_OR_STAT4