* cgen-opc.c (hash_keyword_name): Improve algorithm.
authorDavid Edelsohn <dje.gcc@gmail.com>
Mon, 7 Apr 1997 19:27:12 +0000 (19:27 +0000)
committerDavid Edelsohn <dje.gcc@gmail.com>
Mon, 7 Apr 1997 19:27:12 +0000 (19:27 +0000)
opcodes/ChangeLog
opcodes/cgen-opc.c

index c325a01a0d0a030d075147b1f0643348dcc55d2d..44d482038031ba12cb72c763054c99ca61d5a43f 100644 (file)
@@ -1,5 +1,7 @@
 Mon Apr  7 11:45:44 1997  Doug Evans  <dje@canuck.cygnus.com>
 
+       * cgen-opc.c (hash_keyword_name): Improve algorithm.
+
        * disassemble.c (disassembler): Handle m32r.
 
 Fri Apr  4 12:29:38 1997  Doug Evans  <dje@canuck.cygnus.com>
index cbe9d5cd46e3f3544117ffee884858ba38bdfede..cb622c466beb85863a1bc0070683cbf246f2d746 100644 (file)
@@ -236,7 +236,7 @@ hash_keyword_name (kt, name)
   unsigned int hash;
 
   for (hash = 0; *name; ++name)
-    hash += *name;
+    hash = (hash * 97) + (unsigned char) *name;
   return hash % kt->hash_table_size;
 }