Skip to content

Commit

Permalink
Make a small performance improvement (#808)
Browse files Browse the repository at this point in the history
stop copying the std::pair in the range-based for. This helps improve the speed of RegisterService

Signed-off-by: The MathWorks, Inc. <jdicleme@mathworks.com>
  • Loading branch information
jeffdiclemente committed Feb 15, 2023
1 parent aa759d9 commit b2030d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/src/service/ServiceRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace cppmicroservices

std::vector<std::string> classes;
// Check if service implements claimed classes and that they exist.
for (auto i : *service)
for (auto& i : *service)
{
if (i.first.empty() || (!isFactory && i.second == nullptr))
{
Expand Down

0 comments on commit b2030d2

Please sign in to comment.