Skip to content

Commit dff5c30

Browse files
committed
loop suggestion
1 parent ffd49ec commit dff5c30

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
@@ -93,10 +93,11 @@ iota_range<RTLIB::LibcallImpl>
9393
RuntimeLibcallsInfo::libcallImplNameHit(uint16_t NameOffsetEntry,
9494
uint16_t StrOffset) {
9595
int NumAliases = 1;
96-
for (int E = std::size(RuntimeLibcallNameOffsetTable);
97-
NameOffsetEntry + NumAliases != E &&
98-
RuntimeLibcallNameOffsetTable[NameOffsetEntry + NumAliases] == StrOffset;
99-
++NumAliases) {
96+
for (uint16_t Entry : ArrayRef(RuntimeLibcallNameOffsetTable)
97+
.drop_front(NameOffsetEntry + 1)) {
98+
if (Entry != StrOffset)
99+
break;
100+
++NumAliases;
100101
}
101102

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

0 commit comments

Comments
 (0)