mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Minor replaced insert to emplace C++11
This commit is contained in:
@@ -193,7 +193,7 @@ bool Section::GetKeys(std::vector<std::string> &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;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ bool ZipFileReader::GetFileListing(const char *orig_path, std::vector<File::File
|
||||
if (filter) {
|
||||
while (*filter) {
|
||||
if (*filter == ':') {
|
||||
filters.insert("." + tmp);
|
||||
filters.emplace("." + tmp);
|
||||
tmp.clear();
|
||||
} else {
|
||||
tmp.push_back(*filter);
|
||||
@@ -94,7 +94,7 @@ bool ZipFileReader::GetFileListing(const char *orig_path, std::vector<File::File
|
||||
}
|
||||
|
||||
if (tmp.size())
|
||||
filters.insert("." + tmp);
|
||||
filters.emplace("." + tmp);
|
||||
|
||||
// We just loop through the whole ZIP file and deduce what files are in this directory, and what subdirectories there are.
|
||||
std::set<std::string> files;
|
||||
@@ -175,7 +175,7 @@ bool ZipFileReader::GetZipListings(const std::string &path, std::set<std::string
|
||||
anyPrefixMatched = true;
|
||||
// It's a file.
|
||||
const char *fn = name + path.size();
|
||||
files.insert(std::string(fn));
|
||||
files.emplace(fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ bool initPostfixExpression(const char* infix, IExpressionFunctions* funcs, Postf
|
||||
return false;
|
||||
}
|
||||
|
||||
dest.push_back(ExpressionPair(isFloat?EXCOMM_CONST_FLOAT:EXCOMM_CONST,value));
|
||||
dest.emplace_back(isFloat?EXCOMM_CONST_FLOAT:EXCOMM_CONST,value);
|
||||
lastOpcode = EXOP_NUMBER;
|
||||
} else if ((first >= '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
|
||||
|
||||
@@ -105,7 +105,7 @@ bool IconCache::LoadFromFile(FILE *file) {
|
||||
entry.format = entryHeader.format;
|
||||
entry.insertedTimeStamp = entryHeader.insertedTimestamp;
|
||||
entry.usedTimeStamp = now;
|
||||
cache_.insert(std::pair<std::string, Entry>(key, entry));
|
||||
cache_.emplace(key, entry);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -434,12 +434,12 @@ std::set<std::string> 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user