]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Omit an unnecessary structure initialization in whereLoopAddAll(), replacing
authordrh <>
Fri, 8 Jul 2022 18:23:04 +0000 (18:23 +0000)
committerdrh <>
Fri, 8 Jul 2022 18:23:04 +0000 (18:23 +0000)
it with an assert() to show that the initialization has already occurred, for
a small performance increase and size reduction.

FossilOrigin-Name: 27be9e963459ca0b20c339264125e175550debf50fdbec7d78412768a6326b42

manifest
manifest.uuid
src/where.c

index bfe584d9da89aae425e1e30ac1bd6356d78009df..1708bee800f32058f8bfe0e9d8262e683bd44d54 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Size\sreduction\sand\sperformance\soptimization\sin\swhereLoopAddBtreeIndex().
-D 2022-07-08T17:57:10.112
+C Omit\san\sunnecessary\sstructure\sinitialization\sin\swhereLoopAddAll(),\sreplacing\nit\swith\san\sassert()\sto\sshow\sthat\sthe\sinitialization\shas\salready\soccurred,\sfor\na\ssmall\sperformance\sincrease\sand\ssize\sreduction.
+D 2022-07-08T18:23:04.754
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
 F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -657,7 +657,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
 F src/wal.c 0f34033977b2275793c4330b2ebc3fa180a1baee06591cbc8f6e0d7aaa37988d
 F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a
 F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b
-F src/where.c 6a308f341606d42bc2cefd94d9d6f709027e8584ef54e5e6ef0a1003269a1522
+F src/where.c 54e534ef371b26ac9e4955a35fbefb368fad6ed3cf10abf3a5d748bbaf7f992b
 F src/whereInt.h b48ca529ffe293c18cbfa8326af18a09e39910de66fb3e96ef788c7cbf8ef3a7
 F src/wherecode.c 0b09abfcb88c61c6a6984a3e065786631ff35495e9bdf865e6b74ab0a1299c5b
 F src/whereexpr.c 55a39f42aaf982574fbf52906371a84cceed98a994422198dfd03db4fce4cc46
@@ -1979,8 +1979,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 6f28a9652a3f1e5354afb76314db8f33f92f5e888e336d025f34881c0a8d64ae
-R 6129c6298e998c308adf6a3cb0363d65
+P 64d2312c121e3dabbc1f86effe9dfc57915395466ea2c3746821848f743b8d8f
+R 8acd37a15a19ed816e7bea6945b5086b
 U drh
-Z 5685d150b29f18817c8e694ae059d017
+Z d803b380ec1c17178dfbac162011dfa0
 # Remove this line to create a well-formed Fossil manifest.
index b89caf9f10e3d5d810395c29532f71e4d780a387..2f09d2a86da74d5d189ffedb90f925d9e6b2eab9 100644 (file)
@@ -1 +1 @@
-64d2312c121e3dabbc1f86effe9dfc57915395466ea2c3746821848f743b8d8f
\ No newline at end of file
+27be9e963459ca0b20c339264125e175550debf50fdbec7d78412768a6326b42
\ No newline at end of file
index d28fbd28909977d86ea63aa561ac0d63e1adc68a..14a82783290e2cc8e55b283974f5f57396c55a21 100644 (file)
@@ -4174,7 +4174,13 @@ static int whereLoopAddAll(WhereLoopBuilder *pBuilder){
 
   /* Loop over the tables in the join, from left to right */
   pNew = pBuilder->pNew;
-  whereLoopInit(pNew);
+
+  /* Verify that pNew has already been initialized */
+  assert( pNew->nLTerm==0 );
+  assert( pNew->wsFlags==0 );
+  assert( pNew->nLSlot==ArraySize(pNew->aLTermSpace) );
+  assert( pNew->aLTerm==pNew->aLTermSpace );
+
   pBuilder->iPlanLimit = SQLITE_QUERY_PLANNER_LIMIT;
   for(iTab=0, pItem=pTabList->a; pItem<pEnd; iTab++, pItem++){
     Bitmask mUnusable = 0;