Skip to content

Commit

Permalink
Use emplace to eliminate move/copy operations. (#7861)
Browse files Browse the repository at this point in the history
* Use emplace to eliminate move/copy operations.

* Don't modify third party shipped code

---------

Co-authored-by: David Lowndes <David@DAVIDPCZ>
Co-authored-by: Paul Walker <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent 2b2edda commit 9ad1f54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/SkinModelImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ std::vector<Connector> Connector::connectorsByComponentType(const Component &c)
for (auto it : *idmap)
{
if (it.second->defaultComponent == c)
res.push_back(Connector(it.second));
res.emplace_back(Connector(it.second));
}
return res;
}
Expand Down
2 changes: 1 addition & 1 deletion src/surge-testrunner/UnitTestsLUA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ std::vector<formulaObservation> runFormula(SurgeStorage *storage, FormulaModulat

float r[Surge::Formula::max_formula_outputs];
Surge::Formula::valueAt(iphase, phase, storage, fs, &es, r);
res.push_back(formulaObservation(iphase, phase, r[0]));
res.emplace_back(formulaObservation(iphase, phase, r[0]));
for (int i = 0; i < Surge::Formula::max_formula_outputs; ++i)
res.back().vVec[i] = r[i];

Expand Down
2 changes: 1 addition & 1 deletion src/surge-testrunner/UnitTestsMSEG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ std::vector<msegObservation> runMSEG(MSEGStorage *ms, float dPhase, float phaseM
es.released = release;

auto r = Surge::MSEG::valueAt(iphase, phase, deform, ms, &es, false);
res.push_back(msegObservation(iphase, phase, r));
res.emplace_back(msegObservation(iphase, phase, r));
phase += dPhase;
if (phase > 1)
{
Expand Down

0 comments on commit 9ad1f54

Please sign in to comment.