Skip to content

Commit

Permalink
no need for record comparison operator now that we use hashes to id i…
Browse files Browse the repository at this point in the history
…mages
  • Loading branch information
bcumming committed Feb 13, 2024
1 parent c396979 commit 8a2eee4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions uenv-image
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ class Record:
self._date = date
self._sha256 = sha256

def to_set(self):
# don't use date in the set, because date is not used for comparison.
return (self._system, self._uarch, self._name, self._version, self._tag)
#def to_set(self):
## don't use date in the set, because date is not used for comparison.
#return (self._system, self._uarch, self._name, self._version, self._tag)

def __eq__(self, other):
if not isinstance(other, Record):
return False
return self.to_set==other.to_set()
return self.sha256==other.sha256

def __lt__(self, other):
if self.system < other.system: return True
Expand All @@ -138,9 +138,8 @@ class Record:
#if other.tag < self.tag: return False
return False


def __hash__(self):
return hash(self.to_set())
#def __hash__(self):
#return hash(self.to_set())

def __str__(self):
return f"{self.name}/{self.version}:{self.tag} @ {self.system}:{self.uarch}"
Expand Down

0 comments on commit 8a2eee4

Please sign in to comment.