diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bitvec.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bitvec.c b/src/bitvec.c index 39513ffda..b6420a7f2 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -34,7 +34,7 @@ ** start of a transaction, and is thus usually less than a few thousand, ** but can be as large as 2 billion for a really big database. ** -** @(#) $Id: bitvec.c,v 1.13 2009/01/20 17:06:27 danielk1977 Exp $ +** @(#) $Id: bitvec.c,v 1.14 2009/04/01 23:49:04 drh Exp $ */ #include "sqliteInt.h" @@ -94,8 +94,9 @@ */ struct Bitvec { u32 iSize; /* Maximum bit index. Max iSize is 4,294,967,296. */ - u32 nSet; /* Number of bits that are set - only valid for aHash element */ - /* Max nSet is BITVEC_NINT. For BITVEC_SZ of 512, this would be 125. */ + u32 nSet; /* Number of bits that are set - only valid for aHash + ** element. Max is BITVEC_NINT. For BITVEC_SZ of 512, + ** this would be 125. */ u32 iDivisor; /* Number of bits handled by each apSub[] entry. */ /* Should >=0 for apSub element. */ /* Max iDivisor is max(u32) / BITVEC_NPTR + 1. */ @@ -377,7 +378,8 @@ int sqlite3BitvecBuiltinTest(int sz, int *aOp){ ** is found. */ rc = sqlite3BitvecTest(0,0) + sqlite3BitvecTest(pBitvec, sz+1) - + sqlite3BitvecTest(pBitvec, 0); + + sqlite3BitvecTest(pBitvec, 0) + + (sqlite3BitvecSize(pBitvec) - sz); for(i=1; i<=sz; i++){ if( (TESTBIT(pV,i))!=sqlite3BitvecTest(pBitvec,i) ){ rc = i; |