Minor optimizations. (CVS 4955)

FossilOrigin-Name: e8529455803e0dab167f4faba5846fa1eafef741
This commit is contained in:
drh
2008-04-02 18:33:07 +00:00
parent 6a9ad3da22
commit 41eb9e9986
4 changed files with 18 additions and 17 deletions
+7 -6
View File
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.449 2008/04/02 16:29:31 drh Exp $
** $Id: btree.c,v 1.450 2008/04/02 18:33:08 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -3671,12 +3671,13 @@ int sqlite3BtreeMoveto(
pCell += getVarint32(pCell, &dummy);
}
getVarint(pCell, (u64*)&nCellKey);
if( nCellKey<nKey ){
c = -1;
}else if( nCellKey>nKey ){
c = +1;
}else{
if( nCellKey==nKey ){
c = 0;
}else if( nCellKey<nKey ){
c = -1;
}else{
assert( nCellKey>nKey );
c = +1;
}
}else{
int available;
+3 -3
View File
@@ -12,7 +12,7 @@
** This is the implementation of generic hash-tables
** used in SQLite.
**
** $Id: hash.c,v 1.26 2008/02/18 22:24:58 drh Exp $
** $Id: hash.c,v 1.27 2008/04/02 18:33:08 drh Exp $
*/
#include "sqliteInt.h"
#include <assert.h>
@@ -53,7 +53,7 @@ void sqlite3HashClear(Hash *pH){
assert( pH!=0 );
elem = pH->first;
pH->first = 0;
if( pH->ht ) sqlite3_free(pH->ht);
sqlite3_free(pH->ht);
pH->ht = 0;
pH->htsize = 0;
while( elem ){
@@ -238,7 +238,7 @@ static void rehash(Hash *pH, int new_size){
sqlite3FaultBenign(SQLITE_FAULTINJECTOR_MALLOC, 0);
if( new_ht==0 ) return;
if( pH->ht ) sqlite3_free(pH->ht);
sqlite3_free(pH->ht);
pH->ht = new_ht;
pH->htsize = new_size;
xHash = hashFunction(pH->keyClass);