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

strcache2: collapsed the STRCACHE2_USE_CHAINING checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/strcache2.h

    r1909 r1912  
    3333
    3434#define STRCACHE2_USE_MASK 1
    35 #define STRCACHE2_USE_CHAINING 1
    3635
    3736/* string cache memory segment. */
     
    4847struct strcache2_entry
    4948{
    50 #ifdef STRCACHE2_USE_CHAINING
    5149    struct strcache2_entry *next;       /* Collision chain. */
    52 #endif
    5350    void *user;
    5451    unsigned int hash1;
    55 #ifndef STRCACHE2_USE_CHAINING
    56     unsigned int hash2;
    57 #endif
    5852    unsigned int length;
    5953};
     
    8983    unsigned long collision_3rd_count;  /* The number of 3rd level collisions. */
    9084    unsigned int count;                 /* Number entries in the cache. */
    91 #ifdef STRCACHE2_USE_CHAINING
    9285    unsigned int collision_count;       /* Number of entries in chains. */
    93 #endif
    9486    unsigned int rehash_count;          /* When to rehash the table. */
    9587    unsigned int init_size;             /* The initial hash table size. */
     
    155147}
    156148
    157 #ifndef STRCACHE2_USE_CHAINING
    158 /* Get the second hash value for the string. */
    159 MY_INLINE unsigned int
    160 strcache2_get_hash2 (struct strcache2 *cache, const char *str)
    161 {
    162   unsigned int hash2 = strcache2_get_entry (cache, str)->hash2;
    163   if (!hash2)
    164     hash2 = strcache2_get_hash2_fallback (cache, str);
    165   return hash2;
    166 }
    167 #endif
    168 
    169149/* Get the pointer hash value for the string.
    170150
Note: See TracChangeset for help on using the changeset viewer.