ENH: perfomance: using clear() and empty() more faster for stl containers
This commit is contained in:
parent
dc83f6783e
commit
f4ce49d883
|
@ -1645,7 +1645,7 @@ MathLib::biguint CheckBufferOverrun::countSprintfLength(const std::string &input
|
|||
input_string_size += tempDigits;
|
||||
|
||||
parameterLength = 0;
|
||||
digits_string = "";
|
||||
digits_string.clear();
|
||||
i_d_x_f_found = false;
|
||||
percentCharFound = false;
|
||||
handleNextParameter = false;
|
||||
|
|
|
@ -610,7 +610,7 @@ void CheckStl::pushback()
|
|||
} else {
|
||||
vectorid = 0;
|
||||
}
|
||||
invalidIterator = "";
|
||||
invalidIterator.clear();
|
||||
}
|
||||
|
||||
// push_back on vector..
|
||||
|
|
|
@ -176,7 +176,7 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer, const char Fi
|
|||
if (funcToken->str()==",") {
|
||||
if (++index == argIndex)
|
||||
break;
|
||||
value = "";
|
||||
value.clear();
|
||||
} else
|
||||
value += funcToken->str();
|
||||
funcToken = funcToken->next();
|
||||
|
|
|
@ -72,7 +72,7 @@ Library::Error Library::load(const char exename[], const char path[])
|
|||
if (error == tinyxml2::XML_ERROR_FILE_NOT_FOUND) {
|
||||
// failed to open file.. is there no extension?
|
||||
std::string fullfilename(path);
|
||||
if (Path::getFilenameExtension(fullfilename) == "") {
|
||||
if (Path::getFilenameExtension(fullfilename).empty()) {
|
||||
fullfilename += ".cfg";
|
||||
error = doc.LoadFile(fullfilename.c_str());
|
||||
if (error != tinyxml2::XML_ERROR_FILE_NOT_FOUND)
|
||||
|
|
|
@ -84,7 +84,7 @@ std::string Path::simplifyPath(std::string originalPath)
|
|||
if (originalPath[i] == '/' || originalPath[i] == '\\') {
|
||||
if (subPath.length() > 0) {
|
||||
pathParts.push_back(subPath);
|
||||
subPath = "";
|
||||
subPath.clear();
|
||||
}
|
||||
|
||||
pathParts.push_back(std::string(1 , originalPath[i]));
|
||||
|
|
|
@ -4782,7 +4782,7 @@ bool Tokenizer::simplifyConditions()
|
|||
|
||||
// It is inconclusive whether two unequal float representations are numerically equal
|
||||
if (!eq && MathLib::isFloat(op1))
|
||||
cmp = "";
|
||||
cmp.clear();
|
||||
}
|
||||
|
||||
if (cmp == "==")
|
||||
|
@ -4801,7 +4801,7 @@ bool Tokenizer::simplifyConditions()
|
|||
else if (cmp == "<")
|
||||
result = (op1 < op2);
|
||||
else
|
||||
cmp = "";
|
||||
cmp.clear();
|
||||
}
|
||||
} else {
|
||||
// Compare boolean
|
||||
|
@ -4821,7 +4821,7 @@ bool Tokenizer::simplifyConditions()
|
|||
else if (cmp == "<")
|
||||
result = (op1 < op2);
|
||||
else
|
||||
cmp = "";
|
||||
cmp.clear();
|
||||
}
|
||||
|
||||
if (! cmp.empty()) {
|
||||
|
|
Loading…
Reference in New Issue