--- deliantra/server/common/arch.C 2007/04/16 12:37:08 1.49 +++ deliantra/server/common/arch.C 2007/04/16 13:02:28 1.50 @@ -379,8 +379,9 @@ head->tail_y = 0; // link into list of heads, if not already there - if (!head->next) + if (!head->linked) { + head->linked = true; head->next = first_archetype; first_archetype = head; } @@ -532,36 +533,6 @@ } /* - * Hash-function used by the arch-hashtable. - */ - -unsigned long -hasharch (const char *str, int tablesize) -{ - unsigned long hash = 0; - unsigned int i = 0; - const char *p; - - /* use the one-at-a-time hash function, which supposedly is - * better than the djb2-like one used by perl5.005, but - * certainly is better then the bug used here before. - * see http://burtleburtle.net/bob/hash/doobs.html - */ - for (p = str; i < MAXSTRING && *p; p++, i++) - { - hash += *p; - hash += hash << 10; - hash ^= hash >> 6; - } - - hash += hash << 3; - hash ^= hash >> 11; - hash += hash << 15; - - return hash % tablesize; -} - -/* * Finds, using the hashtable, which archetype matches the given name. * returns a pointer to the found archetype, otherwise NULL. */