Ignore:
Timestamp:
May 16, 2012, 3:02:58 PM (7 years ago)
Author:
ksherdy
Message:

Added bit / byte strategy. Added length test to hash table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/symbol_table/src/hash_table.hpp

    r2103 r2106  
    133133
    134134        while(NULL != crt) {
    135             if(this->compare_strategy.compare(&raw_bytes[idx], crt->raw_bytes, raw_byte_lgth)) {
     135            if((raw_byte_lgth == crt->raw_bytes_lgth)) {
     136                    if (this->compare_strategy.compare(&raw_bytes[idx], crt->raw_bytes, crt->raw_bytes_lgth)) {
    136137                                gid = crt->gid;
    137138                                return true;
     139                    }
    138140            }
    139141            prev = crt;
     
    387389
    388390        while(NULL != crt) {
    389             if(this->compare_strategy.compare(&raw_bytes[idx], crt->raw_bytes, raw_byte_lgth)) {
     391            if(raw_byte_lgth == crt->raw_bytes_lgth) {
     392                if(this->compare_strategy.compare(&raw_bytes[idx], crt->raw_bytes, crt->raw_bytes_lgth)) {
    390393                                gid = crt->gid;
    391394                                return true;
     395                }
    392396            }
    393397            prev = crt;
     
    451455
    452456///////////////////////////////////////////////////////////////////////////
    453 // single - Single Strategy
     457// bit_byte - Strategy
    454458///////////////////////////////////////////////////////////////////////////
    455459template<uint32_t LGTH, int GROUP_STRATEGY, int SCALE_FACTOR, class ALLOCATOR>
    456 class single_hash_table : public hash_table<LGTH, GROUP_STRATEGY, SCALE_FACTOR, ALLOCATOR> {};
    457 
     460class bit_byte_hash_table : public hash_table<LGTH, GROUP_STRATEGY, SCALE_FACTOR, ALLOCATOR> {};
    458461
    459462#endif // HASH_TABLE_HPP
Note: See TracChangeset for help on using the changeset viewer.