--- deliantra/server/common/object.C 2006/09/12 01:09:53 1.34 +++ deliantra/server/common/object.C 2006/09/12 18:15:34 1.35 @@ -418,11 +418,11 @@ object * find_object_name (const char *str) { - const char *name = shstr::find (str); + shstr_cmp str_ (str); object *op; for (op = objects; op != NULL; op = op->next) - if (&op->name == name) + if (op->name == str_) break; return op; @@ -852,7 +852,7 @@ mortals.erase (i); } - if (mortals.size())//D + if (mortals.size() && 0)//D LOG (llevDebug, "%d objects in mortal queue\n", mortals.size());//D } @@ -2722,34 +2722,27 @@ const char * get_ob_key_value (const object *op, const char *const key) { - key_value * - link; - const char * - canonical_key; - - canonical_key = shstr::find (key); + key_value *link; + shstr_cmp canonical_key (key); - if (canonical_key == NULL) + if (!canonical_key) { /* 1. There being a field named key on any object * implies there'd be a shared string to find. * 2. Since there isn't, no object has this field. * 3. Therefore, *this* object doesn't have this field. */ - return NULL; + return 0; } /* This is copied from get_ob_key_link() above - * only 4 lines, and saves the function call overhead. */ - for (link = op->key_values; link != NULL; link = link->next) - { - if (link->key == canonical_key) - { - return link->value; - } - } - return NULL; + for (link = op->key_values; link; link = link->next) + if (link->key == canonical_key) + return link->value; + + return 0; }