lookup_object: remove hashtable_index() and optimize hash_obj()