aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2002-06-17 17:03:00 +0000
committerDaniel Veillard <veillard@src.gnome.org>2002-06-17 17:03:00 +0000
commit5f7f991ab7055c1a96aed0127cebfa22a180c181 (patch)
tree9d1387960c1528c91852cb08d45e63c11cd4544d
parent21473679f7ada2f947e93065eb26c67970695c46 (diff)
downloadandroid_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--ChangeLog5
-rw-r--r--hash.c9
-rw-r--r--include/libxml/schemasInternals.h2
3 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b859bdea..c68cab41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/hash.c b/hash.c
index f01e6b90..4000f8d3 100644
--- a/hash.c
+++ b/hash.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);