Ignore:
Timestamp:
04/18/14 01:51:17 (10 years ago)
Author:
Maciej Komosinski
Message:
  • SString::hash() and HashTable? use FNV-1a instead of FNV-1
  • fixed the initial hash value
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/hashtable.cpp

    r197 r226  
    55#include "hashtable.h"
    66
    7 int HashTable::hash(const char *s)
     7int HashTable::hash(const SString &s)
    88{
    9 int h=0;
    10 char c;
    11 while(c=*(s++))
    12     h=31*h+c;
    13 return h&0x7fffffff;
     9return s.hash()&0x7fffffff;
    1410}
    1511
Note: See TracChangeset for help on using the changeset viewer.