diff --git a/Common/Data/Format/IniFile.cpp b/Common/Data/Format/IniFile.cpp index 54396e8164..44916f5c02 100644 --- a/Common/Data/Format/IniFile.cpp +++ b/Common/Data/Format/IniFile.cpp @@ -193,7 +193,7 @@ bool Section::GetKeys(std::vector &keys) const { keys.clear(); for (auto liter = lines_.begin(); liter != lines_.end(); ++liter) { if (!liter->Key().empty()) - keys.push_back(std::string(liter->Key())); + keys.emplace_back(liter->Key()); } return true; } diff --git a/Common/File/VFS/ZipFileReader.cpp b/Common/File/VFS/ZipFileReader.cpp index 501c448a5c..8c9ddc505c 100644 --- a/Common/File/VFS/ZipFileReader.cpp +++ b/Common/File/VFS/ZipFileReader.cpp @@ -84,7 +84,7 @@ bool ZipFileReader::GetFileListing(const char *orig_path, std::vector files; @@ -175,7 +175,7 @@ bool ZipFileReader::GetZipListings(const std::string &path, std::set= 'a' && first <= 'z') || first == '@') { @@ -271,14 +271,14 @@ bool initPostfixExpression(const char* infix, IExpressionFunctions* funcs, Postf uint32_t value; if (funcs->parseReference(subStr,value) == true) { - dest.push_back(ExpressionPair(EXCOMM_REF,value)); + dest.emplace_back(EXCOMM_REF,value); lastOpcode = EXOP_NUMBER; continue; } if (funcs->parseSymbol(subStr,value) == true) { - dest.push_back(ExpressionPair(EXCOMM_CONST,value)); + dest.emplace_back(EXCOMM_CONST,value); lastOpcode = EXOP_NUMBER; continue; } @@ -311,7 +311,7 @@ bool initPostfixExpression(const char* infix, IExpressionFunctions* funcs, Postf ExpressionOpcodeType t = opcodeStack[opcodeStack.size()-1]; opcodeStack.pop_back(); if (t == EXOP_BRACKETL) break; - dest.push_back(ExpressionPair(EXCOMM_OP,t)); + dest.emplace_back(EXCOMM_OP,t); } break; case EXOP_MEMR: @@ -326,10 +326,10 @@ bool initPostfixExpression(const char* infix, IExpressionFunctions* funcs, Postf opcodeStack.pop_back(); if (t == EXOP_MEML) { - dest.push_back(ExpressionPair(EXCOMM_OP,EXOP_MEM)); + dest.emplace_back(EXCOMM_OP,EXOP_MEM); break; } - dest.push_back(ExpressionPair(EXCOMM_OP,t)); + dest.emplace_back(EXCOMM_OP,t); } type = EXOP_NUMBER; break; @@ -350,7 +350,7 @@ bool initPostfixExpression(const char* infix, IExpressionFunctions* funcs, Postf if (ExpressionOpcodes[t].Priority >= CurrentPriority) { - dest.push_back(ExpressionPair(EXCOMM_OP,t)); + dest.emplace_back(EXCOMM_OP,t); } else { opcodeStack.push_back(t); break; @@ -375,7 +375,7 @@ bool initPostfixExpression(const char* infix, IExpressionFunctions* funcs, Postf expressionError = "Parenthesis not closed"; return false; } - dest.push_back(ExpressionPair(EXCOMM_OP,t)); + dest.emplace_back(EXCOMM_OP,t); } #if 0 // only for testing diff --git a/Common/UI/IconCache.cpp b/Common/UI/IconCache.cpp index f2529ec141..7b5bd0a8b8 100644 --- a/Common/UI/IconCache.cpp +++ b/Common/UI/IconCache.cpp @@ -105,7 +105,7 @@ bool IconCache::LoadFromFile(FILE *file) { entry.format = entryHeader.format; entry.insertedTimeStamp = entryHeader.insertedTimestamp; entry.usedTimeStamp = now; - cache_.insert(std::pair(key, entry)); + cache_.emplace(key, entry); } return true; diff --git a/Core/MIPS/IR/IRNativeCommon.cpp b/Core/MIPS/IR/IRNativeCommon.cpp index 784d0c7ae2..bb1589303b 100644 --- a/Core/MIPS/IR/IRNativeCommon.cpp +++ b/Core/MIPS/IR/IRNativeCommon.cpp @@ -683,7 +683,7 @@ void IRNativeBackend::SetBlockCheckedOffset(int block_num, int offset) { } void IRNativeBackend::AddLinkableExit(int block_num, uint32_t pc, int exitStartOffset, int exitLen) { - linksTo_.insert(std::make_pair(pc, block_num)); + linksTo_.emplace(pc, block_num); if (block_num >= (int)nativeBlocks_.size()) nativeBlocks_.resize(block_num + 1); diff --git a/Windows/Debugger/CtrlDisAsmView.cpp b/Windows/Debugger/CtrlDisAsmView.cpp index 8d9809fd8f..597fa3f547 100644 --- a/Windows/Debugger/CtrlDisAsmView.cpp +++ b/Windows/Debugger/CtrlDisAsmView.cpp @@ -434,12 +434,12 @@ std::set CtrlDisAsmView::getSelectedLineArguments() { manager.getLine(addr, displaySymbols, line); size_t p = 0, nextp = line.params.find(','); while (nextp != line.params.npos) { - args.insert(line.params.substr(p, nextp - p)); + args.emplace(line.params.substr(p, nextp - p)); p = nextp + 1; nextp = line.params.find(',', p); } if (p < line.params.size()) { - args.insert(line.params.substr(p)); + args.emplace(line.params.substr(p)); } }