]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/include/hash-table.hh
release: 1.3.33
[lilypond.git] / flower / include / hash-table.hh
index 491feb3df7106fab4674d04c2421ad66bb383e10..bd437e6e972d7215f9546fcce539d789cbd809b0 100644 (file)
@@ -61,9 +61,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 +74,6 @@ public:
          return i;
 
        j++;
-       i = (i + j*j) % sz;
       }
 
       
@@ -151,8 +153,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;