mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 23:21:11 +00:00
[clang-query] Use StringRef::ltrim (NFC)
This commit is contained in:
parent
1e05236dbd
commit
12bba0d4f8
@ -28,10 +28,8 @@ namespace query {
|
||||
// is found before End, return StringRef(). Begin is adjusted to exclude the
|
||||
// lexed region.
|
||||
StringRef QueryParser::lexWord() {
|
||||
Line = Line.drop_while([](char c) {
|
||||
// Don't trim newlines.
|
||||
return StringRef(" \t\v\f\r").contains(c);
|
||||
});
|
||||
// Don't trim newlines.
|
||||
Line = Line.ltrim(" \t\v\f\r");
|
||||
|
||||
if (Line.empty())
|
||||
// Even though the Line is empty, it contains a pointer and
|
||||
@ -152,8 +150,7 @@ QueryRef QueryParser::parseSetTraversalKind(TraversalKind QuerySession::*Var) {
|
||||
|
||||
QueryRef QueryParser::endQuery(QueryRef Q) {
|
||||
StringRef Extra = Line;
|
||||
StringRef ExtraTrimmed = Extra.drop_while(
|
||||
[](char c) { return StringRef(" \t\v\f\r").contains(c); });
|
||||
StringRef ExtraTrimmed = Extra.ltrim(" \t\v\f\r");
|
||||
|
||||
if ((!ExtraTrimmed.empty() && ExtraTrimmed[0] == '\n') ||
|
||||
(ExtraTrimmed.size() >= 2 && ExtraTrimmed[0] == '\r' &&
|
||||
|
Loading…
Reference in New Issue
Block a user