File tree Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Expand file tree Collapse file tree 3 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,8 @@ class Lexer {
97
97
}
98
98
case ' =' :
99
99
Buf = Buf.drop_front ();
100
- if (Buf.starts_with (" =" )) {
101
- Buf = Buf.drop_front ();
100
+ if (Buf.consume_front (" =" ))
102
101
return Token (EqualEqual, " ==" );
103
- }
104
102
return Token (Equal, " =" );
105
103
case ' ,' :
106
104
Buf = Buf.drop_front ();
Original file line number Diff line number Diff line change @@ -1816,8 +1816,7 @@ std::string DotCfgDiffNode::getBodyContent() const {
1816
1816
for (unsigned I = 0 ; I < 2 ; ++I) {
1817
1817
SR[I] = Data[I]->getBody ();
1818
1818
// drop initial '\n' if present
1819
- if (SR[I][0 ] == ' \n ' )
1820
- SR[I] = SR[I].drop_front ();
1819
+ SR[I].consume_front (" \n " );
1821
1820
// drop predecessors as they can be big and are redundant
1822
1821
SR[I] = SR[I].drop_until ([](char C) { return C == ' \n ' ; }).drop_front ();
1823
1822
}
Original file line number Diff line number Diff line change @@ -77,8 +77,8 @@ formatv_object_base::parseReplacementItem(StringRef Spec) {
77
77
assert (false && " Invalid replacement field layout specification!" );
78
78
}
79
79
RepString = RepString.trim ();
80
- if (! RepString.empty () && RepString. front () == ' : ' ) {
81
- Options = RepString.drop_front (). trim ();
80
+ if (RepString.consume_front ( " : " ) ) {
81
+ Options = RepString.trim ();
82
82
RepString = StringRef ();
83
83
}
84
84
RepString = RepString.trim ();
You can’t perform that action at this time.
0 commit comments