methodmap_method_t *methodmap_find_method(methodmap_t *map, const char *name) { for (const auto& method : map->methods) { if (strcmp(method->name, name) == 0) return method.get(); } if (map->parent) return methodmap_find_method(map->parent, name); return nullptr; }
methodmap_method_t *methodmap_find_method(methodmap_t *map, const char *name) { size_t i; for (i = 0; i < map->nummethods; i++) { if (strcmp(map->methods[i]->name, name) == 0) return map->methods[i]; } if (map->parent) return methodmap_find_method(map->parent, name); return NULL; }