Skip to content

Commit 84ff1bd

Browse files
[RISCV] Use StringRef in a range-based for loop (NFC) (#144243)
When we iterate over std::vector<std::string>, we can directly assign each element to StringRef. We do not need to go through a separate statement.
1 parent c4ba734 commit 84ff1bd

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/TargetParser/RISCVISAInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ RISCVISAInfo::parseFeatures(unsigned XLen,
449449
assert(XLen == 32 || XLen == 64);
450450
std::unique_ptr<RISCVISAInfo> ISAInfo(new RISCVISAInfo(XLen));
451451

452-
for (auto &Feature : Features) {
453-
StringRef ExtName = Feature;
452+
for (StringRef ExtName : Features) {
454453
assert(ExtName.size() > 1 && (ExtName[0] == '+' || ExtName[0] == '-'));
455454
bool Add = ExtName[0] == '+';
456455
ExtName = ExtName.drop_front(1); // Drop '+' or '-'

0 commit comments

Comments
 (0)