if (JBE_ISNULL(*e) && key->type == jbvNull)
{
r->type = jbvNull;
+ r->estSize = sizeof(JEntry);
if (lowbound)
*lowbound = i;
- r->estSize = sizeof(JEntry);
return r;
}
return r;
}
}
- else if (JBE_ISBOOL(*e) && key->type == jbvBool)
- {
- if ((JBE_ISBOOL_TRUE(*e) && key->boolean) ||
- (JBE_ISBOOL_FALSE(*e) && !key->boolean))
- {
- /* Deep copy */
- *r = *key;
- r->estSize = sizeof(JEntry);
- if (lowbound)
- *lowbound = i;
-
- return r;
- }
- }
else if (JBE_ISNUMERIC(*e) && key->type == jbvNumeric)
{
Numeric entry = (Numeric) (data + INTALIGN(JBE_OFF(*e)));
{
r->type = jbvNumeric;
r->numeric = entry;
+ if (lowbound)
+ *lowbound = i;
+ return r;
+ }
+ }
+ else if (JBE_ISBOOL(*e) && key->type == jbvBool)
+ {
+ if ((JBE_ISBOOL_TRUE(*e) && key->boolean) ||
+ (JBE_ISBOOL_FALSE(*e) && !key->boolean))
+ {
+ r->type = jbvBool;
+ r->boolean = JBE_ISBOOL_TRUE(*e) != 0;
+ r->estSize = sizeof(JEntry);
if (lowbound)
*lowbound = i;
if (lowbound)
*lowbound = stopMiddle + 1;
- if (JBE_ISSTRING(*v))
+ if (JBE_ISNULL(*v))
+ {
+ r->type = jbvNull;
+ r->estSize = sizeof(JEntry);
+ }
+ else if (JBE_ISSTRING(*v))
{
r->type = jbvString;
r->string.val = data + JBE_OFF(*v);
r->string.len = JBE_LEN(*v);
r->estSize = sizeof(JEntry) + r->string.len;
}
- else if (JBE_ISBOOL(*v))
- {
- r->type = jbvBool;
- r->boolean = JBE_ISBOOL_TRUE(*v) != 0;
- r->estSize = sizeof(JEntry);
- }
else if (JBE_ISNUMERIC(*v))
{
r->type = jbvNumeric;
r->estSize = 2 * sizeof(JEntry) + VARSIZE_ANY(r->numeric);
}
- else if (JBE_ISNULL(*v))
+ else if (JBE_ISBOOL(*v))
{
- r->type = jbvNull;
+ r->type = jbvBool;
+ r->boolean = JBE_ISBOOL_TRUE(*v) != 0;
r->estSize = sizeof(JEntry);
}
else
{
/*
- * See header comments to understand why this function
- * never does this for arrays
+ * See header comments to understand why this never happens
+ * with arrays
*/
r->type = jbvBinary;
r->binary.data = data + INTALIGN(JBE_OFF(*v));