Ignore:
Timestamp:
Oct 11, 2008, 9:59:17 PM (17 years ago)
Author:
bird
Message:

better? predictions can do bad stuff...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/variable.c

    r1829 r1840  
    352352#else /* VARIABLE_HASH */
    353353
    354 # ifdef __GNUC__
    355 #  define PREDICT_TRUE(expr)  __builtin_expect(!!(expr), 1)
    356 #  define PREDICT_FALSE(expr) __builtin_expect(!!(expr), 0)
    357 # else
    358 #  define PREDICT_TRUE(expr)  (expr)
    359 #  define PREDICT_FALSE(expr) (expr)
    360 # endif
    361 
    362354inline static int
    363355variable_hash_cmp_2_memcmp (const char *xs, const char *ys, unsigned int length)
     
    446438          result  = *(int32_t*)xs - *(int32_t*)ys;
    447439          result |= *(int32_t*)(xs + 4) - *(int32_t*)(ys + 4);
    448           if (PREDICT_FALSE(result))
     440          if (MY_PREDICT_FALSE(result))
    449441            return result;
    450442          xs += 8;
     
    514506          result |= xs[4] - ys[4];
    515507#endif
    516           if (PREDICT_FALSE(result))
     508          if (MY_PREDICT_FALSE(result))
    517509            return result;
    518510          xs += 8;
     
    559551  result = (x->hash1 - y->hash1)
    560552         | (x->length - y->length);
    561   if (PREDICT_TRUE(result))
     553  if (MY_PREDICT_TRUE(result))
    562554    return result;
    563555
Note: See TracChangeset for help on using the changeset viewer.