]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/rendermethod.cpp
Use emplace_back when a new object is being constructed
[libs/gl.git] / source / materials / rendermethod.cpp
index 5c838ef945624629483ea2fff992b1564285137a..ddbe4f1e457e83760dc699bce85ad52dd64ac29e 100644 (file)
@@ -81,7 +81,7 @@ void RenderMethod::set_texture(Tag tag, const Texture *tex, const Sampler *samp)
        auto i = find_member(textures, tag, &TextureSlot::tag);
        if(i==textures.end())
        {
-               textures.push_back(TextureSlot(tag));
+               textures.emplace_back(tag);
                i = textures.end()-1;
        }
        i->texture = tex;
@@ -216,7 +216,7 @@ void RenderMethod::Loader::texture(const string &n)
        auto i = find_member(obj.textures, Tag(n), &TextureSlot::tag);
        if(i==obj.textures.end())
        {
-               obj.textures.push_back(TextureSlot(n));
+               obj.textures.emplace_back(n);
                i = obj.textures.end()-1;
        }
        TextureSlot::Loader ldr(*i, n, coll);