1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

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
This commit is contained in:
Daniel Veillard 2002-06-17 17:03:00 +00:00
parent 21473679f7
commit 5f7f991ab7
3 changed files with 10 additions and 6 deletions

View File

@ -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

9
hash.c
View File

@ -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);

View File

@ -266,6 +266,8 @@ struct _xmlSchema {
xmlHashTablePtr notaDecl;
xmlHashTablePtr schemasImports;
void *_private; /* unused by the library for users or bindings */
};
void xmlSchemaFreeType (xmlSchemaTypePtr type);