Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdphk committed Dec 2, 2022
1 parent 9ca335d commit 8e353a8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions pyreveng/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,28 @@ def __init__(self, lo, hi):
self.hi = hi

def __repr__(self):
s = "<tree_leaf 0x%x-0x%x" % (self.lo, self.hi)
return s + ">"
return "<tree_leaf 0x%x-0x%x>" % (self.lo, self.hi)

def __lt__(self, other):
if self.lo != other.lo:
return self.lo < other.lo
return self.hi < other.hi

def __eq__(self, other):
return self.lo == other.lo and self.hi != other.hi
return self.lo == other.lo and self.hi == other.hi

def __contains__(self, a):
return self.lo <= a < self.hi

class Tree():

limit = 128

def __init__(self, lo, hi):
# lim is only a performance parameter, it does not change
def __init__(self, lo, hi, limit=128):
# limit is only a performance parameter, it does not change
# funcationality in any way.
self.lo = lo
self.mid = (lo + hi) // 2
self.hi = hi
self.limit = limit
self.less = None
self.more = None
self.cuts = list()
Expand Down

0 comments on commit 8e353a8

Please sign in to comment.