Use emplace_* functions where in-place construction is preferable

This commit is contained in:
Lioncash committed 2015-02-04 11:39:08 -05:00
1 parent 012a4c18ff
commit e07679114b
12 files changed
+18 -18

No files matched your search

+1 -1
View File
@@ -33,7 +33,7 @@ void LabelMap::RegisterLabel(const std::string &label, u16 lval, LabelType type)
label.c_str(), lval, old_value);
DeleteLabel(label);
}
labels.push_back(label_t(label, lval, type));
labels.emplace_back(label, lval, type);
}
void LabelMap::DeleteLabel(const std::string &label)
+1 -1
View File
@@ -434,7 +434,7 @@ inline s32 GCMemcardDirectory::SaveAreaRW(u32 block, bool writing)
int num_blocks = BE16(m_saves[i].m_gci_header.BlockCount);
while (num_blocks)
{
m_saves[i].m_save_data.push_back(GCMBlock());
m_saves[i].m_save_data.emplace_back();
num_blocks--;
}
}
+1 -1
View File
@@ -186,7 +186,7 @@ namespace JitILProfiler
static Block& Add(u64 codeHash)
{
const u32 _blockIndex = (u32)blocks.size();
blocks.push_back(Block());
blocks.emplace_back();
Block& block = blocks.back();
block.index = _blockIndex;
block.codeHash = codeHash;
+1 -1
View File
@@ -153,7 +153,7 @@ namespace JitInterface
u64 timecost = block->ticCounter;
// Todo: tweak.
if (block->runCount >= 1)
stats.push_back(BlockStat(i, cost));
stats.emplace_back(i, cost);
cost_sum += cost;
timecost_sum += timecost;
}
+1 -1
View File
@@ -175,7 +175,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol &func, int max_size)
if (target != INVALID_TARGET && instr.LK)
{
//we found a branch-n-link!
func.calls.push_back(SCall(target,addr));
func.calls.emplace_back(target, addr);
func.flags &= ~FFLAG_LEAF;
}
}