Skip to content

Commit 11706e6

Browse files
committed
Fix warning about returning a ref to temporary
1 parent bb013d7 commit 11706e6

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Introspection.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,7 @@ void Schema::AddType(response::StringType name, std::shared_ptr<object::__Type>
3434

3535
const std::shared_ptr<object::__Type>& Schema::LookupType(const response::StringType& name) const
3636
{
37-
auto itr = _typeMap.find(name);
38-
39-
if (itr == _typeMap.cend())
40-
{
41-
return nullptr;
42-
}
43-
44-
return _types[itr->second].second;
37+
return _types[_typeMap.find(name)->second].second;
4538
}
4639

4740
void Schema::AddDirective(std::shared_ptr<object::__Directive> directive)

0 commit comments

Comments
 (0)