untangling do_lookup() - take __lookup_hash()-calling case out of line.