diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-06-17 17:03:00 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-06-17 17:03:00 +0000 |
commit | 5f7f991ab7055c1a96aed0127cebfa22a180c181 (patch) | |
tree | 9d1387960c1528c91852cb08d45e63c11cd4544d | |
parent | 21473679f7ada2f947e93065eb26c67970695c46 (diff) | |
download | android_external_libxml2-5f7f991ab7055c1a96aed0127cebfa22a180c181.tar.gz android_external_libxml2-5f7f991ab7055c1a96aed0127cebfa22a180c181.tar.bz2 android_external_libxml2-5f7f991ab7055c1a96aed0127cebfa22a180c181.zip |
applied patch from Sander Vesik improving the quality of the hash
* hash.c: applied patch from Sander Vesik improving the quality of
the hash function.
Daniel
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | hash.c | 9 | ||||
-rw-r--r-- | include/libxml/schemasInternals.h | 2 |
3 files changed, 10 insertions, 6 deletions
@@ -1,3 +1,8 @@ +Mon Jun 17 19:02:49 CEST 2002 Daniel Veillard <daniel@veillard.com> + + * hash.c: applied patch from Sander Vesik improving the quality of + the hash function. + 2002-06-14 Aleksey Sanin <aleksey@aleksey.com> * DOCBparser.c HTMLparser.c debugXML.c encoding.c @@ -66,20 +66,17 @@ xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, if (name != NULL) { value += 30 * (*name); while ((ch = *name++) != 0) { - /* value *= 31; */ - value += (unsigned long)ch; + value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } if (name2 != NULL) { while ((ch = *name2++) != 0) { - /* value *= 31; */ - value += (unsigned long)ch; + value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } if (name3 != NULL) { while ((ch = *name3++) != 0) { - /* value *= 31; */ - value += (unsigned long)ch; + value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } return (value % table->size); diff --git a/include/libxml/schemasInternals.h b/include/libxml/schemasInternals.h index b8d850b2..cd14fb2a 100644 --- a/include/libxml/schemasInternals.h +++ b/include/libxml/schemasInternals.h @@ -266,6 +266,8 @@ struct _xmlSchema { xmlHashTablePtr notaDecl; xmlHashTablePtr schemasImports; + + void *_private; /* unused by the library for users or bindings */ }; void xmlSchemaFreeType (xmlSchemaTypePtr type); |