aboutsummaryrefslogtreecommitdiff
path: root/src/bitvec.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-06-30 16:29:59 +0000
committerdrh <drh@noemail.net>2015-06-30 16:29:59 +0000
commit59b4bd48402d7e3fd43c6421c914f941381ad67f (patch)
tree610aac3f446aa781e946a4f01f91496acae59cb9 /src/bitvec.c
parentbe7d4978365fe110e08ad2ef2f4b09a19f350660 (diff)
parentda6d3e2117fd2ab1cbcc0f21ac5839d08d04344e (diff)
downloadsqlite-59b4bd48402d7e3fd43c6421c914f941381ad67f.tar.gz
sqlite-59b4bd48402d7e3fd43c6421c914f941381ad67f.zip
Merge all the latest enhancements from trunk. This merge include FTS5
and a number of notable performance enhancements. FossilOrigin-Name: 39936b33b0668aad81aa574d4d74c92b0ddd218a
Diffstat (limited to 'src/bitvec.c')
-rw-r--r--src/bitvec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/bitvec.c b/src/bitvec.c
index c34897454..fd908f791 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -126,10 +126,10 @@ Bitvec *sqlite3BitvecCreate(u32 iSize){
** If p is NULL (if the bitmap has not been created) or if
** i is out of range, then return false.
*/
-int sqlite3BitvecTest(Bitvec *p, u32 i){
- if( p==0 ) return 0;
- if( i>p->iSize || i==0 ) return 0;
+int sqlite3BitvecTestNotNull(Bitvec *p, u32 i){
+ assert( p!=0 );
i--;
+ if( i>=p->iSize ) return 0;
while( p->iDivisor ){
u32 bin = i/p->iDivisor;
i = i%p->iDivisor;
@@ -149,6 +149,9 @@ int sqlite3BitvecTest(Bitvec *p, u32 i){
return 0;
}
}
+int sqlite3BitvecTest(Bitvec *p, u32 i){
+ return p!=0 && sqlite3BitvecTestNotNull(p,i);
+}
/*
** Set the i-th bit. Return 0 on success and an error code if