Refactorization: Use std::string::pop_back
Merged from LCppC.
This commit is contained in:
parent
2fa2fec24f
commit
ef82897af5
|
@ -257,7 +257,7 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[])
|
|||
else if (std::strncmp(argv[i], "--cppcheck-build-dir=", 21) == 0) {
|
||||
mSettings->buildDir = Path::fromNativeSeparators(argv[i] + 21);
|
||||
if (endsWith(mSettings->buildDir, '/'))
|
||||
mSettings->buildDir.erase(mSettings->buildDir.size() - 1U);
|
||||
mSettings->buildDir.pop_back();
|
||||
}
|
||||
|
||||
// Show --debug output after the first simplifications
|
||||
|
|
|
@ -561,7 +561,7 @@ void simplecpp::TokenList::readfile(std::istream &istr, const std::string &filen
|
|||
portabilityBackslash(outputList, files, location);
|
||||
if (currentToken[currentToken.size() - 1U] == '\\') {
|
||||
++multiline;
|
||||
currentToken.erase(currentToken.size() - 1U);
|
||||
currentToken.pop_back();
|
||||
} else {
|
||||
ungetChar(istr, bom);
|
||||
}
|
||||
|
@ -606,7 +606,7 @@ void simplecpp::TokenList::readfile(std::istream &istr, const std::string &filen
|
|||
if (ch == '\"' && !prefix.empty() && *cback()->str().rbegin() == 'R') {
|
||||
std::string delim;
|
||||
currentToken = ch;
|
||||
prefix.resize(prefix.size() - 1);
|
||||
prefix.pop_back();
|
||||
ch = readChar(istr,bom);
|
||||
while (istr.good() && ch != '(' && ch != '\n') {
|
||||
delim += ch;
|
||||
|
@ -1147,7 +1147,7 @@ std::string simplecpp::TokenList::readUntil(std::istream &istr, const Location &
|
|||
do {
|
||||
next = readChar(istr, bom);
|
||||
if (next == '\r' || next == '\n') {
|
||||
ret.erase(ret.size()-1U);
|
||||
ret.pop_back();
|
||||
backslash = (next == '\r');
|
||||
update_ch = false;
|
||||
} else if (next == '\\')
|
||||
|
@ -2176,7 +2176,7 @@ namespace simplecpp {
|
|||
|
||||
// remove trailing dot if path ends with "/."
|
||||
if (endsWith(path,"/."))
|
||||
path.erase(path.size()-1);
|
||||
path.pop_back();
|
||||
|
||||
// simplify ".."
|
||||
pos = 1; // don't simplify ".." if path starts with that
|
||||
|
|
|
@ -175,7 +175,7 @@ bool Token::isUpperCaseName() const
|
|||
|
||||
void Token::concatStr(std::string const& b)
|
||||
{
|
||||
mStr.erase(mStr.length() - 1);
|
||||
mStr.pop_back();
|
||||
mStr.append(getStringLiteral(b) + "\"");
|
||||
|
||||
if (isCChar() && isStringLiteral(b) && b[0] != '"') {
|
||||
|
|
Loading…
Reference in New Issue