Skip to content

Commit

Permalink
fix: [spearbit-96] make clearFlag consistent in clear() for associate…
Browse files Browse the repository at this point in the history
…dLinkedList (#69)
  • Loading branch information
fangting-alchemy authored and adamegyed committed Jan 19, 2024
1 parent 4de467c commit b916142
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libraries/AssociatedLinkedListSetLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ library AssociatedLinkedListSetLib {
bytes32 cursor = SENTINEL_VALUE;

do {
bytes32 cleared = clearFlags(cursor);
StoragePointer cursorSlot = _mapLookup(keyBuffer, cleared);
bytes32 next = _load(cursorSlot);
StoragePointer cursorSlot = _mapLookup(keyBuffer, cursor);
bytes32 next = clearFlags(_load(cursorSlot));
_store(cursorSlot, bytes32(0));
cursor = next;
} while (!isSentinel(cursor) && cursor != bytes32(0));
Expand Down

0 comments on commit b916142

Please sign in to comment.