Skip to content

Commit 12bba0d

Browse files
[clang-query] Use StringRef::ltrim (NFC)
1 parent 1e05236 commit 12bba0d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

clang-tools-extra/clang-query/QueryParser.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ namespace query {
2828
// is found before End, return StringRef(). Begin is adjusted to exclude the
2929
// lexed region.
3030
StringRef QueryParser::lexWord() {
31-
Line = Line.drop_while([](char c) {
32-
// Don't trim newlines.
33-
return StringRef(" \t\v\f\r").contains(c);
34-
});
31+
// Don't trim newlines.
32+
Line = Line.ltrim(" \t\v\f\r");
3533

3634
if (Line.empty())
3735
// Even though the Line is empty, it contains a pointer and
@@ -152,8 +150,7 @@ QueryRef QueryParser::parseSetTraversalKind(TraversalKind QuerySession::*Var) {
152150

153151
QueryRef QueryParser::endQuery(QueryRef Q) {
154152
StringRef Extra = Line;
155-
StringRef ExtraTrimmed = Extra.drop_while(
156-
[](char c) { return StringRef(" \t\v\f\r").contains(c); });
153+
StringRef ExtraTrimmed = Extra.ltrim(" \t\v\f\r");
157154

158155
if ((!ExtraTrimmed.empty() && ExtraTrimmed[0] == '\n') ||
159156
(ExtraTrimmed.size() >= 2 && ExtraTrimmed[0] == '\r' &&

0 commit comments

Comments
 (0)