Skip to content

Commit 96c279f

Browse files
committed
loop suggestion
1 parent bb16958 commit 96c279f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

llvm/lib/IR/RuntimeLibcalls.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ iota_range<RTLIB::LibcallImpl>
6666
RuntimeLibcallsInfo::libcallImplNameHit(uint16_t NameOffsetEntry,
6767
uint16_t StrOffset) {
6868
int NumAliases = 1;
69-
for (int E = std::size(RuntimeLibcallNameOffsetTable);
70-
NameOffsetEntry + NumAliases != E &&
71-
RuntimeLibcallNameOffsetTable[NameOffsetEntry + NumAliases] == StrOffset;
72-
++NumAliases) {
69+
for (uint16_t Entry : ArrayRef(RuntimeLibcallNameOffsetTable)
70+
.drop_front(NameOffsetEntry + 1)) {
71+
if (Entry != StrOffset)
72+
break;
73+
++NumAliases;
7374
}
7475

7576
RTLIB::LibcallImpl ImplStart = static_cast<RTLIB::LibcallImpl>(

0 commit comments

Comments
 (0)