Skip to content

Commit 3eacaa3

Browse files
[ADT] Refactor DenseMapIterator::operator-> (NFC) (#157227)
This patchs implement DenseMapIterator::operator-> in terms of operator* to reduce code duplication.
1 parent dc81dcf commit 3eacaa3

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

llvm/include/llvm/ADT/DenseMap.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,13 +1242,7 @@ class DenseMapIterator : DebugEpochBase::HandleBase {
12421242
return Ptr[-1];
12431243
return *Ptr;
12441244
}
1245-
pointer operator->() const {
1246-
assert(isHandleInSync() && "invalid iterator access!");
1247-
assert(Ptr != End && "dereferencing end() iterator");
1248-
if (shouldReverseIterate<KeyT>())
1249-
return &(Ptr[-1]);
1250-
return Ptr;
1251-
}
1245+
pointer operator->() const { return &operator*(); }
12521246

12531247
friend bool operator==(const DenseMapIterator &LHS,
12541248
const DenseMapIterator &RHS) {

0 commit comments

Comments
 (0)