Skip to content

Commit 1bbdc76

Browse files
Apply suggestion from @steffenlarsen
Co-authored-by: Steffen Larsen <[email protected]>
1 parent d4459f9 commit 1bbdc76

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sycl/source/detail/device_global_map_entry.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@ OwnedUrEvent DeviceGlobalUSMMem::getInitEvent(adapter_impl &Adapter) {
5555

5656
bool DeviceGlobalMapEntry::isAvailableInContext(const context_impl *CtxImpl) {
5757
std::lock_guard<std::mutex> Lock{MDeviceToUSMPtrMapMutex};
58-
for (const auto &It : MDeviceToUSMPtrMap)
59-
if (It.first.second == CtxImpl)
60-
return true;
61-
return false;
58+
std::any_of(MDeviceToUSMPtrMap.begin(), MDeviceToUSMPtrMap.end(),
59+
[CtxImpl](const auto &It) { return It.first.second == CtxImpl; });
6260
}
6361

6462
bool DeviceGlobalMapEntry::isProfileCounter() {

0 commit comments

Comments
 (0)