Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
doublesharp committed Jan 20, 2024
1 parent bc3677e commit 70b5494
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions contracts/BokkyPooBahsRedBlackTreeLibrary.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ pragma solidity ^0.8.23;
// Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2020. The MIT Licence.
// ----------------------------------------------------------------------------
library BokkyPooBahsRedBlackTreeLibrary {
uint72 private constant EMPTY = 0;

uint8 constant RED_FLAG_BIT = uint8(7);
uint8 constant RED_FLAG_MASK = uint8(1 << RED_FLAG_BIT);
uint8 constant NUM_IN_SEGMENT_MASK = uint8((1 << RED_FLAG_BIT) - 1);

struct Tree {
uint72 root;
mapping(uint72 => Node) nodes;
}

struct Node {
uint72 parent;
uint72 left;
Expand Down Expand Up @@ -56,13 +63,6 @@ library BokkyPooBahsRedBlackTreeLibrary {
}
}

struct Tree {
uint72 root;
mapping(uint72 => Node) nodes;
}

uint72 private constant EMPTY = 0;

function first(Tree storage self) internal view returns (uint72 _key) {
_key = self.root;
if (_key != EMPTY) {
Expand Down Expand Up @@ -127,7 +127,6 @@ library BokkyPooBahsRedBlackTreeLibrary {
function edit(Tree storage self, uint72 key, uint32 extraTombstoneOffset, uint8 numInSegmentDeleted) internal {
require(exists(self, key));
self.nodes[key].tombstoneOffset += extraTombstoneOffset;
// self.nodes[key].numInSegmentDeleted = numInSegmentDeleted;
setNumInSegmentDeleted(self.nodes[key], numInSegmentDeleted);
}

Expand Down

0 comments on commit 70b5494

Please sign in to comment.