Skip to content

Commit

Permalink
♻️ Fix EnumerableSetLib.Uint8Set.at (#1089)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized authored Sep 19, 2024
1 parent b9ce42e commit 1312da6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils/EnumerableSetLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -645,15 +645,14 @@ library EnumerableSetLib {
/// @solidity memory-safe-assembly
assembly {
let packed := sload(set.slot)
for {} i {
for {} 1 {
mstore(0x00, 0x4e23d035) // `IndexOutOfBounds()`.
revert(0x1c, 0x04)
} {
if iszero(lt(i, 256)) { continue }
for { let j := 0 } 1 {} {
for { let j := 0 } iszero(eq(i, j)) {} {
packed := xor(packed, and(packed, add(1, not(packed))))
j := add(j, 1)
if iszero(xor(i, j)) { break }
}
if iszero(packed) { continue }
break
Expand Down

0 comments on commit 1312da6

Please sign in to comment.