mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 15:10:09 -05:00
use .erase() instead of assigning to a substr of itself
This commit is contained in:
1 parent
48bd4c5719
commit
d79db2b700
1 file changed
+2
-2
@@ -68,7 +68,7 @@ namespace Ewoms {
|
||||
// remove comments
|
||||
auto commentPos = curLine.find("%");
|
||||
if (commentPos != curLine.npos) {
|
||||
curLine = curLine.substr(0, commentPos);
|
||||
curLine.erase(commentPos);
|
||||
}
|
||||
|
||||
// remove leading whitespace
|
||||
@@ -84,7 +84,7 @@ namespace Ewoms {
|
||||
while (curLine.size() > numTrailingSpaces
|
||||
&& std::isspace(curLine[curLine.size() - numTrailingSpaces]))
|
||||
++numTrailingSpaces;
|
||||
curLine = curLine.substr(0, curLine.size() - numTrailingSpaces);
|
||||
curLine.erase(numTrailingSpaces);
|
||||
|
||||
// a section of the file is finished, go to the next one
|
||||
if (curLine == "$") {
|
||||
|
||||
Reference in new issue
Block a user