bool method_map_contains(const MethodMap& mmap, borrowed_ptr<const php::Class> cls, borrowed_ptr<const php::Func> func) { std::string const clsname = cls ? cls->name->data() : ""; auto it = mmap.find(clsname); if (it == end(mmap)) return false; return it->second.count(func->name->data()); }
Method* Profiler::find_method(Env* env, rmethod cm, rsymbol container, rsymbol name, Kind kind) { method_id id = create_id(env, cm, container, name, kind); Method* method; MethodMap::iterator iter = methods_.find(id); if(iter == methods_.end()) { method = new Method(id, name, container, kind); methods_[method->id()] = method; } else { method = iter->second; } return method; }