Skip to content

Commit

Permalink
Revise emplace_back() to push_back() and fix Mac clang complaint.
Browse files Browse the repository at this point in the history
In both cases we have a created object we want to move onto the vector.

Mac's clang objects to the first std::move() as it's applied to a
temporary and disables copy elision.
  • Loading branch information
Jim Hague committed Aug 3, 2021
1 parent b2c942f commit 255b6f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions react_juce/core/EcmascriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ namespace reactjuce
{
if (!i.isString())
return false;
sources.emplace_back(std::move(i.toString()));
sources.push_back(i.toString());
}

bool firstSegmentInLine = true;
Expand Down Expand Up @@ -182,7 +182,7 @@ namespace reactjuce

if (*p == ';')
{
mappings.emplace_back(std::move(lineSegments));
mappings.push_back(std::move(lineSegments));
firstSegmentInLine = true;
}
}
Expand Down

0 comments on commit 255b6f9

Please sign in to comment.