1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-12 23:22:53 +03:00

Add the likely() function for symmetry with unlikely(). The likely(X)

function means the same thing as likelihood(X,0.9375).

FossilOrigin-Name: 38965484199153e3e5b999f5196c1d66e5296f60
This commit is contained in:
drh
2014-06-17 16:11:28 +00:00
parent e2bdf6e547
commit 03202a97f8
6 changed files with 48 additions and 14 deletions

View File

@@ -711,7 +711,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
** likelihood(X, 0.0625).
** EVIDENCE-OF: R-01283-11636 The unlikely(X) function is short-hand for
** likelihood(X,0.0625). */
pExpr->iTable = 62; /* TUNING: Default 2nd arg to unlikely() is 0.0625 */
/* TUNING: unlikely() probability is 0.0625. likely() is 0.9375 */
pExpr->iTable = pDef->zName[0]=='u' ? 62 : 938;
}
}
}