Skip to content

Commit f7a6f81

Browse files
authored
Merge pull request #787 from aismann/dev
rename push_back vs emplace_back (fine tuning and remove on Live2D (t…
2 parents 28dd328 + 8b408b2 commit f7a6f81

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

core/2d/CCParticleSystem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,18 +2314,18 @@ void ParticleEmissionMaskCache::bakeEmissionMask(std::string_view maskId,
23142314
float a = data[(y * w + x) * 4 + 3] / 255.0F;
23152315
if (a >= alphaThreshold && !inverted)
23162316
for (float i = 0; i < 1.0F; i += 1.0F / inbetweenSamples)
2317-
points.push_back({float(x + i), float(h - y + i)});
2317+
points.emplace_back(Vec2{float(x + i), float(h - y + i)});
23182318
if (a < alphaThreshold && inverted)
23192319
for (float i = 0; i < 1.0F; i += 1.0F / inbetweenSamples)
2320-
points.push_back({float(x + i), float(h - y + i)});
2320+
points.emplace_back(Vec2{float(x + i), float(h - y + i)});
23212321
}
23222322
else
23232323
{
23242324
float a = data[(y * w + x) * 4 + 3] / 255.0F;
23252325
if (a >= alphaThreshold && !inverted)
2326-
points.push_back({float(x), float(h - y)});
2326+
points.emplace_back(Vec2{float(x), float(h - y)});
23272327
if (a < alphaThreshold && inverted)
2328-
points.push_back({float(x), float(h - y)});
2328+
points.emplace_back(Vec2{float(x), float(h - y)});
23292329
}
23302330
}
23312331

extensions/Live2D/Framework/src/CubismFramework.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void* CubismFramework::Allocate(csmSizeType size, const csmChar* fileName, csmIn
228228

229229
if (s_allocationList)
230230
{
231-
s_allocationList->emplace_back(address);
231+
s_allocationList->push_back(address);
232232
}
233233

234234
return address;
@@ -242,7 +242,7 @@ void* CubismFramework::AllocateAligned(csmSizeType size, csmUint32 alignment, co
242242

243243
if (s_allocationList)
244244
{
245-
s_allocationList->emplace_back(address);
245+
s_allocationList->push_back(address);
246246
}
247247

248248
return address;

tests/lua-tests/project/Classes/lua_test_bindings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ int lua_cocos2dx_DrawNode3D_drawCube(lua_State* L)
581581
}
582582
#endif
583583
// arg0[i] = vec3;
584-
arg0.push_back(vec3);
584+
arg0.emplace_back(vec3);
585585
lua_pop(L, 1);
586586
}
587587

0 commit comments

Comments
 (0)