Simplify the estLog() routine.

FossilOrigin-Name: 6c68d758bce3752f044752404a76bf3ba3eec48f
This commit is contained in:
drh 2014-06-12 15:46:46 +00:00
parent 77ae7ca643
commit 696964d0e5
3 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Avoid\san\sunnecessary\sinitialization\sof\sthe\sszFile\sfield\sof\sunixFile\sin\nthe\sunix\sVFS.
D 2014-06-09T20:39:03.676
C Simplify\sthe\sestLog()\sroutine.
D 2014-06-12T15:46:46.043
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -294,7 +294,7 @@ F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd
F src/wal.c 76e7fc6de229bea8b30bb2539110f03a494dc3a8
F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
F src/walker.c 11edb74d587bc87b33ca96a5173e3ec1b8389e45
F src/where.c 1c0a0b1f132915c8b9d2c6a4aecd45654d2a9708
F src/where.c 778943263d3d6de375f9e983998d61d61810e9d5
F src/whereInt.h 929c1349b5355fd44f22cee5c14d72b3329c58a6
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@ -1174,7 +1174,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P 10707d35786403ea5392d980f593bfecdae063dd
R 5c924f630188cdd6e1f0b84a36c79d61
P 6484fb5a25c2a0e5d26694285a4908a22c67ba17
R 34527842724eabaf8c54b06a4f0df0d3
U drh
Z b2fa1d596ef871591a5ab3a0251e8787
Z d9811e61b520e89dd1ac8e506eeb59a8

View File

@ -1 +1 @@
6484fb5a25c2a0e5d26694285a4908a22c67ba17
6c68d758bce3752f044752404a76bf3ba3eec48f

View File

@ -1494,8 +1494,7 @@ static int isDistinctRedundant(
** Estimate the logarithm of the input value to base 2.
*/
static LogEst estLog(LogEst N){
LogEst x = N<0 ? 1 : sqlite3LogEst(N);
return x>33 ? x - 33 : 0;
return N<=10 ? 0 : sqlite3LogEst(N) - 33;
}
/*