mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 18:56:40 +00:00
Don't return SemanticsFunction by value. (#2968)
It contains a vector, so it's not cheap to copy. Return by const reference instead. Thanks to @fasiddique for spotting this!
This commit is contained in:
1 parent
3c7bca4115
commit
f992d4d960
3 files changed
+4
-3
No files matched your search
@@ -24,7 +24,7 @@ auto SemanticsHandleCallExpression(SemanticsContext& context,
|
||||
}
|
||||
|
||||
auto function_id = name_node.GetAsFunctionDeclaration();
|
||||
auto callable = context.semantics_ir().GetFunction(function_id);
|
||||
const auto& callable = context.semantics_ir().GetFunction(function_id);
|
||||
|
||||
CARBON_DIAGNOSTIC(NoMatchingCall, Error, "No matching callable was found.");
|
||||
auto diagnostic =
|
||||
|
||||
Reference in new issue
Block a user