Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
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;
}