Use in-place construction.

This was SVN commit r16894.
This commit is contained in:
leper
2015-07-29 23:44:17 +00:00
parent c5eb9b7bb7
commit 8bfe16cac8
20 changed files with 40 additions and 40 deletions
+5 -5
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2012 Wildfire Games.
/* Copyright (C) 2015 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -94,7 +94,7 @@ typename CShaderParams<value_t>::SItems* CShaderParams<value_t>::GetInterned(con
ENSURE(std::adjacent_find(items.items.begin(), items.items.end(), std::binary_negate<Cmp>(Cmp())) == items.items.end());
shared_ptr<SItems> ptr(new SItems(items));
s_InternedItems.insert(std::make_pair(items, ptr));
s_InternedItems.emplace(items, ptr);
return ptr.get();
}
@@ -245,15 +245,15 @@ void CShaderRenderQueries::Add(const char* name)
{
if (name == CStr("sim_time"))
{
m_Items.push_back(std::make_pair(RQUERY_TIME, CStrIntern(name)));
m_Items.emplace_back(RQUERY_TIME, CStrIntern(name));
}
else if (name == CStr("water_tex"))
{
m_Items.push_back(std::make_pair(RQUERY_WATER_TEX, CStrIntern(name)));
m_Items.emplace_back(RQUERY_WATER_TEX, CStrIntern(name));
}
else if (name == CStr("sky_cube"))
{
m_Items.push_back(std::make_pair(RQUERY_SKY_CUBE, CStrIntern(name)));
m_Items.emplace_back(RQUERY_SKY_CUBE, CStrIntern(name));
}
}