Skip to content

Commit 08968d4

Browse files
committed
parser-gcc: use std::string::back/pop_back()
... instead of iterators and resizing.
1 parent 94b17e8 commit 08968d4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/parser-gcc.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ EToken Tokenizer::readNext(DefEvent *pEvt)
115115
return T_EMPTY;
116116

117117
// drop CR at end of the line, coming from GCC in source code snippets
118-
// NOTE: std::string::back/pop_back() would look better but requires C++11
119-
if ('\r' == *line.rbegin())
120-
line.resize(line.size() - 1U);
118+
if ('\r' == line.back())
119+
line.pop_back();
121120

122121
lineNo_++;
123122

0 commit comments

Comments
 (0)