Changeset 2198


Ignore:
Timestamp:
May 30, 2012, 5:15:27 PM (7 years ago)
Author:
ksherdy
Message:

Bake in delimeters.

File:
1 edited

Legend:

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

    r2106 r2198  
    363363///////////////////////////////////////////////////////////////////////////
    364364
    365 // TODO - delimeters at compile time
    366365static char XMLdelimiters[] = {' ', '\0', '\0', ';', '\0', '=', '>', '/'};
    367 static IDISA_ALWAYS_INLINE bool isXMLDelimiter(const char c) {
    368     return c == XMLdelimiters[(unsigned int) c & 0x7];
     366static IDISA_ALWAYS_INLINE bool is_XML_delimeter(const char c) {
     367    return c == XMLdelimiters[(unsigned int) c & 0x7] || c == '<';
    369368}
    370369
    371 static IDISA_ALWAYS_INLINE bool isGeneralDelimiter(const char c) {
    372     return !(('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z'));
    373 }
    374 
    375 static IDISA_ALWAYS_INLINE bool isTestDelimiter(const char c) {
     370static IDISA_ALWAYS_INLINE bool is_test_delimeter(const char c) {
    376371    return c == ',';
    377372}
     373
    378374
    379375template<uint32_t LGTH, int GROUP_STRATEGY, int SCALE_FACTOR, class ALLOCATOR>
     
    432428                    return gid;
    433429                }
    434 
    435                 hash_table_odd.pool_and_insert(bucket, raw_bytes, idx+1, lgth-1, h0, h1, gid_factory, gid_data, gid);
     430                this->hash_table_odd.pool_and_insert(bucket, raw_bytes, idx+1, lgth-1, h0, h1, gid_factory, gid_data, gid);
     431
    436432                return gid;
    437433            }
     
    441437protected:
    442438
    443     static IDISA_ALWAYS_INLINE bool is_delimeter(const char delim) {
    444         return ::isTestDelimiter(delim);
    445     }
     439                static IDISA_ALWAYS_INLINE bool is_delimeter(const char c) {
     440
     441                        #ifdef TEST_DELIMETER
     442                                return is_test_delimeter(c);
     443                        #else
     444                                return is_XML_delimeter(c);
     445                        #endif
     446
     447                }
    446448
    447449    id_hash_table<LGTH-1, div2, SCALE_FACTOR, ALLOCATOR> hash_table_odd;
Note: See TracChangeset for help on using the changeset viewer.