Commit 06f3abe2 authored by vitaut's avatar vitaut

Return early from ArgMap::find

parent 50f14f22
...@@ -1681,13 +1681,13 @@ class ArgMap { ...@@ -1681,13 +1681,13 @@ class ArgMap {
FMT_API void init(const ArgList &args); FMT_API void init(const ArgList &args);
const internal::Arg* find(const fmt::BasicStringRef<Char> &name) const { const internal::Arg* find(const fmt::BasicStringRef<Char> &name) const {
typename MapType::const_iterator it = map_.begin(); // The list is unsorted, so just return the first matching name.
// the list is unsorted, so just return the first matching name. for (typename MapType::const_iterator it = map_.begin(), end = map_.end();
for (; it != map_.end(); ++it) { it != end; ++it) {
if (it->first == name) if (it->first == name)
break; return &it->second;
} }
return it != map_.end() ? &it->second : 0; return 0;
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment