From e64dfe76b24e69e0698b4f75adae17faa5cf5ba2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 14 Mar 2020 18:45:34 -0400 Subject: [PATCH] CFontImageDef: Make use of emplace_back where applicable Same behavior, but constructs the instances directly within the container. --- Runtime/GuiSys/CFontImageDef.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Runtime/GuiSys/CFontImageDef.cpp b/Runtime/GuiSys/CFontImageDef.cpp index 6cabc6d3c..e20b52403 100644 --- a/Runtime/GuiSys/CFontImageDef.cpp +++ b/Runtime/GuiSys/CFontImageDef.cpp @@ -8,13 +8,14 @@ CFontImageDef::CFontImageDef(const std::vector>& texs, float in const zeus::CVector2f& cropFactor) : x0_fps(interval), x14_cropFactor(cropFactor) { x4_texs.reserve(texs.size()); - for (const TToken& tok : texs) - x4_texs.push_back(tok); + for (const TToken& tok : texs) { + x4_texs.emplace_back(tok); + } } CFontImageDef::CFontImageDef(const TToken& tex, const zeus::CVector2f& cropFactor) : x0_fps(0.f), x14_cropFactor(cropFactor) { - x4_texs.push_back(tex); + x4_texs.emplace_back(tex); } bool CFontImageDef::IsLoaded() const {