X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fhash-table.hh;h=f3f5bfe23402768e46f5206593b24abc5fd186d3;hb=87aedc5e4e7c56bb54a29f604eafc177a37e3f05;hp=491feb3df7106fab4674d04c2421ad66bb383e10;hpb=2873636a53f0011f837aaf6e2072de602730d957;p=lilypond.git diff --git a/flower/include/hash-table.hh b/flower/include/hash-table.hh index 491feb3df7..f3f5bfe234 100644 --- a/flower/include/hash-table.hh +++ b/flower/include/hash-table.hh @@ -43,7 +43,9 @@ struct Hash_table_entry A hash table of prime size. We use quadratic probing. - */ + + DEPRECATED. Use either SCM (preferred) or STL +*/ template class Fixed_size_hash_table { @@ -61,9 +63,12 @@ public: int lookup (K s, unsigned int initial_hash) { int sz =dict_arr_.size (); - int i = initial_hash % sz; + initial_hash = initial_hash % sz; + int i; int j = 0; while (j <= sz/2) { + i = (initial_hash + j*j) % sz; + if (dict_arr_[i].free_b_) return i; @@ -71,7 +76,6 @@ public: return i; j++; - i = (i + j*j) % sz; } @@ -151,8 +155,8 @@ public: } /** - Find and return element. If #s# is not in the table, create an entry in the table, and init - */ + Find and return element. If #s# is not in the table, create an + entry in the table, and init */ V& elem (K s) { int l;