From cb6dbcdf04e525762f5142d03bd5655757e82a8a Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 21:47:57 +0000 Subject: [PATCH] lilypond-1.1.35 --- flower/hash.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/flower/hash.cc b/flower/hash.cc index c2fd954a8f..c33e7ed53d 100644 --- a/flower/hash.cc +++ b/flower/hash.cc @@ -1,3 +1,11 @@ +/* + hash.cc -- implement various functions for hash tables. + + source file of the Flower Library + + (c) 1999 Han-Wen Nienhuys + + */ #include "string.hh" #include "array.hh" #include "dictionary.hh" @@ -6,6 +14,7 @@ // Note: assumes long is at least 32 bits. const unsigned long my_prime_list[] = { + 5, 11, 23, // be a bit careful for short lists: we want reasonable mem usage. 53, 97, 193, 389, 769, 1543, 3079, 6151, 12289, 24593, 49157, 98317, 196613, 393241, 786433, @@ -14,12 +23,14 @@ const unsigned long my_prime_list[] = 1610612741u, 3221225473u, 4294967291u }; -unsigned long prime_list (int idx) +unsigned long +prime_list (int idx) { return my_prime_list [idx]; } -unsigned int string_hash (String s) +unsigned int +string_hash (String s) { const char* str = s.ch_C (); unsigned int result = 0; @@ -32,14 +43,15 @@ unsigned int string_hash (String s) } -unsigned int hash (unsigned int i) +unsigned int +hash (unsigned int i) { return i; } -unsigned int int_hash (int i) +unsigned int +int_hash (int i) { return (unsigned) i; } -unsigned int hash ( ); -- 2.39.5