Skip to content

Commit 4931a24

Browse files
committed
Use C++20 std::map::contains in WTF::SequesteredArenaAllocator
https://bugs.webkit.org/show_bug.cgi?id=312531 rdar://174968857 Reviewed by Darin Adler. * Source/WTF/wtf/SequesteredAllocator.h: Canonical link: https://commits.webkit.org/311460@main
1 parent 28b1824 commit 4931a24

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Source/WTF/wtf/SequesteredAllocator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ class alignas(sequesteredArenaAllocatorAlignment) SequesteredArenaAllocator {
389389

390390
auto oldDebugKey = reinterpret_cast<uintptr_t>(p);
391391
auto newDebugKey = reinterpret_cast<uintptr_t>(newP);
392-
RELEASE_ASSERT(m_allocationInfos.count(oldDebugKey) > 0);
392+
RELEASE_ASSERT(m_allocationInfos.contains(oldDebugKey));
393393
m_allocationInfos[newDebugKey] = m_allocationInfos[oldDebugKey];
394394

395395
return reallocateInto(p, newP, newSize);
@@ -487,7 +487,7 @@ class alignas(sequesteredArenaAllocatorAlignment) SequesteredArenaAllocator {
487487

488488
if constexpr (trackAllocationDebugInfo) {
489489
auto debugKey = reinterpret_cast<uintptr_t>(p);
490-
RELEASE_ASSERT(m_allocationInfos.count(debugKey) > 0);
490+
RELEASE_ASSERT(m_allocationInfos.contains(debugKey));
491491
m_allocationInfos[debugKey].live = false;
492492
m_allocationInfos.erase(debugKey);
493493
}
@@ -498,7 +498,7 @@ class alignas(sequesteredArenaAllocatorAlignment) SequesteredArenaAllocator {
498498
if constexpr (trackAllocationDebugInfo) {
499499
auto oldDebugKey = reinterpret_cast<uintptr_t>(from);
500500
auto newDebugKey = reinterpret_cast<uintptr_t>(to);
501-
RELEASE_ASSERT(m_allocationInfos.count(oldDebugKey) > 0);
501+
RELEASE_ASSERT(m_allocationInfos.contains(oldDebugKey));
502502
m_allocationInfos[newDebugKey] = m_allocationInfos[oldDebugKey];
503503
m_allocationInfos[oldDebugKey].live = false;
504504
m_allocationInfos[newDebugKey].size = newSize;

0 commit comments

Comments
 (0)