Merge pull request #221 from lioncash/emplace

CFontImageDef: Make use of emplace_back where applicable
This commit is contained in:
Luke Street 2020-03-15 19:44:23 -04:00 committed by GitHub
commit e1d622d47b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -8,13 +8,14 @@ CFontImageDef::CFontImageDef(const std::vector<TToken<CTexture>>& texs, float in
const zeus::CVector2f& cropFactor)
: x0_fps(interval), x14_cropFactor(cropFactor) {
x4_texs.reserve(texs.size());
for (const TToken<CTexture>& tok : texs)
x4_texs.push_back(tok);
for (const TToken<CTexture>& tok : texs) {
x4_texs.emplace_back(tok);
}
}
CFontImageDef::CFontImageDef(const TToken<CTexture>& 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 {