Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a0e886

Browse filesBrowse files
[BOLT] Use StringRef::consume_front (NFC) (#139432)
1 parent ac9b778 commit 2a0e886
Copy full SHA for 2a0e886

File tree

1 file changed

+2
-4
lines changed
Filter options

1 file changed

+2
-4
lines changed

‎bolt/lib/Profile/DataReader.cpp

Copy file name to clipboardExpand all lines: bolt/lib/Profile/DataReader.cpp
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,9 +1035,8 @@ ErrorOr<SampleInfo> DataReader::parseSampleInfo() {
10351035
}
10361036

10371037
ErrorOr<bool> DataReader::maybeParseNoLBRFlag() {
1038-
if (ParsingBuf.size() < 6 || ParsingBuf.substr(0, 6) != "no_lbr")
1038+
if (!ParsingBuf.consume_front("no_lbr"))
10391039
return false;
1040-
ParsingBuf = ParsingBuf.drop_front(6);
10411040
Col += 6;
10421041

10431042
if (ParsingBuf.size() > 0 && ParsingBuf[0] == ' ')
@@ -1058,9 +1057,8 @@ ErrorOr<bool> DataReader::maybeParseNoLBRFlag() {
10581057
}
10591058

10601059
ErrorOr<bool> DataReader::maybeParseBATFlag() {
1061-
if (ParsingBuf.size() < 16 || ParsingBuf.substr(0, 16) != "boltedcollection")
1060+
if (!ParsingBuf.consume_front("boltedcollection"))
10621061
return false;
1063-
ParsingBuf = ParsingBuf.drop_front(16);
10641062
Col += 16;
10651063

10661064
if (!checkAndConsumeNewLine()) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.