From: dan Date: Sat, 4 Jun 2011 20:13:24 +0000 (+0000) Subject: Remove some unreachable code. X-Git-Tag: version-3.7.7~62^2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76e04431ef98a94d50a64540e518df5d34c6fe0d;p=thirdparty%2Fsqlite.git Remove some unreachable code. FossilOrigin-Name: 650e1a79eda5a2134a1fbd305ab1f205a57c0892 --- diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 695d3e2d5e..5654dab214 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -447,20 +447,6 @@ static void fts3GetReverseVarint( *pVal = iVal; } -/* -** As long as *pp has not reached its end (pEnd), then do the same -** as fts3GetDeltaVarint(): read a single varint and add it to *pVal. -** But if we have reached the end of the varint, just set *pp=0 and -** leave *pVal unchanged. -*/ -static void fts3GetDeltaVarint2(char **pp, char *pEnd, sqlite3_int64 *pVal){ - if( *pp>=pEnd ){ - *pp = 0; - }else{ - fts3GetDeltaVarint(pp, pVal); - } -} - /* ** The xDisconnect() virtual table method. */ @@ -1912,188 +1898,6 @@ static int fts3PoslistNearMerge( } } -/* -** Values that may be used as the first parameter to fts3DoclistMerge(). -*/ -#define MERGE_NOT 2 /* D + D -> D */ -#define MERGE_AND 3 /* D + D -> D */ -#define MERGE_OR 4 /* D + D -> D */ -#define MERGE_PHRASE 6 /* P + P -> D */ -#define MERGE_NEAR 8 /* P + P -> D */ - -#define MERGE_POS_OR 5 /* P + P -> P */ -#define MERGE_POS_PHRASE 7 /* P + P -> P */ -#define MERGE_POS_NEAR 9 /* P + P -> P */ - -/* -** Merge the two doclists passed in buffer a1 (size n1 bytes) and a2 -** (size n2 bytes). The output is written to pre-allocated buffer aBuffer, -** which is guaranteed to be large enough to hold the results. The number -** of bytes written to aBuffer is stored in *pnBuffer before returning. -** -** If successful, SQLITE_OK is returned. Otherwise, if a malloc error -** occurs while allocating a temporary buffer as part of the merge operation, -** SQLITE_NOMEM is returned. -*/ -static int fts3DoclistMerge( - int mergetype, /* One of the MERGE_XXX constants */ - int nParam1, /* Used by MERGE_NEAR and MERGE_POS_NEAR */ - int nParam2, /* Used by MERGE_NEAR and MERGE_POS_NEAR */ - char *aBuffer, /* Pre-allocated output buffer */ - int *pnBuffer, /* OUT: Bytes written to aBuffer */ - char *a1, /* Buffer containing first doclist */ - int n1, /* Size of buffer a1 */ - char *a2, /* Buffer containing second doclist */ - int n2, /* Size of buffer a2 */ - int *pnDoc /* OUT: Number of docids in output */ -){ - sqlite3_int64 i1 = 0; - sqlite3_int64 i2 = 0; - sqlite3_int64 iPrev = 0; - - char *p = aBuffer; - char *p1 = a1; - char *p2 = a2; - char *pEnd1 = &a1[n1]; - char *pEnd2 = &a2[n2]; - int nDoc = 0; - - assert( mergetype==MERGE_OR || mergetype==MERGE_POS_OR - || mergetype==MERGE_AND || mergetype==MERGE_NOT - || mergetype==MERGE_PHRASE || mergetype==MERGE_POS_PHRASE - || mergetype==MERGE_NEAR || mergetype==MERGE_POS_NEAR - ); - assert( mergetype==MERGE_POS_PHRASE || mergetype==MERGE_POS_NEAR ); - - if( !aBuffer ){ - *pnBuffer = 0; - return SQLITE_NOMEM; - } - - /* Read the first docid from each doclist */ - fts3GetDeltaVarint2(&p1, pEnd1, &i1); - fts3GetDeltaVarint2(&p2, pEnd2, &i2); - - switch( mergetype ){ - case MERGE_OR: - case MERGE_POS_OR: - while( p1 || p2 ){ - if( p2 && p1 && i1==i2 ){ - fts3PutDeltaVarint(&p, &iPrev, i1); - if( mergetype==MERGE_POS_OR ) fts3PoslistMerge(&p, &p1, &p2); - fts3GetDeltaVarint2(&p1, pEnd1, &i1); - fts3GetDeltaVarint2(&p2, pEnd2, &i2); - }else if( !p2 || (p1 && i1isReqPos ? MERGE_POS_OR : MERGE_OR); char *aOut = 0; int nOut = 0; int i; @@ -2406,7 +2208,6 @@ static int fts3TermSelectCb( return SQLITE_NOMEM; } }else{ - int mergetype = (pTS->isReqPos ? MERGE_POS_OR : MERGE_OR); char *aMerge = aDoclist; int nMerge = nDoclist; int iOut; @@ -3816,7 +3617,7 @@ static void fts3EvalNearMerge( char *aOut; /* Buffer in which to assemble new doclist */ int nOut; /* Size of buffer aOut in bytes */ - *pRc = fts3DoclistNearMerge(bDescIdx, MERGE_POS_NEAR, nNear, + *pRc = fts3DoclistNearMerge(bDescIdx, nNear, pLeft->nToken, pLeft->doclist.aAll, pLeft->doclist.nAll, pRight->nToken, pRight->doclist.aAll, pRight->doclist.nAll, &aOut, &nOut diff --git a/manifest b/manifest index 7bf78b4a1d..34f7d97ba5 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Allow\sthe\s"order=DESC"\sand\s"order=ASC"\sparameters\sin\sFTS4\s"CREATE\sVIRTUAL\sTABLE"\sstatements.\sTables\screated\swith\s"order=DESC"\sstore\sall\sdoclists\sin\sdescending\sorder,\swhich\sallows\soptimizations\snormally\sapplied\sto\s"ORDER\sBY\sdocid\sASC"\squeries\sto\sbe\sused\swith\s"ORDER\sBY\sdocid\sDESC"\squeries\sinstead. -D 2011-06-04T20:04:35.492 +C Remove\ssome\sunreachable\scode. +D 2011-06-04T20:13:24.690 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 11dcc00a8d0e5202def00e81732784fb0cc4fe1d F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -61,7 +61,7 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0 F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9 F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c 432c902c697850cbc5ffc2be8a945ac7ac3328d7 +F ext/fts3/fts3.c 31f73cae1d21daba547c471a0a78d31e7516a29e F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3Int.h d76b021d5b7061eff7aa4055b5938eebef2bdb6a F ext/fts3/fts3_aux.c 28fc512608e147015c36080025456f57f571f76f @@ -939,7 +939,7 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P a4c7e2820824e82580730c36f85aede2efa66754 -R 2bf28954217e137f11160d52b346ca5f +P f6a0193f5a32603eb48bddc6297042dbd2ffe96e +R a65937620eeff7552523045d1ea22bb7 U dan -Z b16ce48fbf2f9ba7236a3b596adb6f59 +Z 582e1f65a0e245127649a23c8e5f1248 diff --git a/manifest.uuid b/manifest.uuid index 2d5316d141..a27947ef64 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -f6a0193f5a32603eb48bddc6297042dbd2ffe96e \ No newline at end of file +650e1a79eda5a2134a1fbd305ab1f205a57c0892 \ No newline at end of file