Skip to content

Commit ffaedc2

Browse files
[Basic] Simplify uses of StringRef::consume_front (NFC)
1 parent 90e9c6e commit ffaedc2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

clang/lib/Basic/Targets/AMDGPU.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
168168
return true;
169169
}
170170

171-
bool HasLeftParen = false;
172-
if (S.consume_front("{"))
173-
HasLeftParen = true;
171+
bool HasLeftParen = S.consume_front("{");
174172
if (S.empty())
175173
return false;
176174
if (S.front() != 'v' && S.front() != 's' && S.front() != 'a') {
@@ -196,9 +194,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo {
196194
Name = S.data() - 1;
197195
return true;
198196
}
199-
bool HasLeftBracket = false;
200-
if (S.consume_front("["))
201-
HasLeftBracket = true;
197+
bool HasLeftBracket = S.consume_front("[");
202198
unsigned long long N;
203199
if (S.empty() || consumeUnsignedInteger(S, 10, N))
204200
return false;

0 commit comments

Comments
 (0)