fix insane config bottleneck

This commit is contained in:
Yonokid
2025-06-12 18:58:06 -04:00
parent 014c68c443
commit ebf098d8c2
9 changed files with 44 additions and 33 deletions

View File

@@ -35,10 +35,13 @@ class Note:
def __le__(self, other):
return self.hit_ms <= other.hit_ms
def __eq__(self, other):
return self.hit_ms == other.hit_ms
def _get_hash_data(self) -> bytes:
"""Get deterministic byte representation for hashing"""
field_values = []
for f in sorted([f.name for f in fields(self)]): # Sort for consistency
for f in sorted([f.name for f in fields(self)]):
value = getattr(self, f, None)
field_values.append((f, value))
field_values.append(('__class__', self.__class__.__name__))
@@ -66,6 +69,9 @@ class Drumroll(Note):
def __repr__(self):
return str(self.__dict__)
def __eq__(self, other):
return self.hit_ms == other.hit_ms
def __post_init__(self):
for field_name in [f.name for f in fields(Note)]:
if hasattr(self._source_note, field_name):
@@ -94,6 +100,9 @@ class Balloon(Note):
def __repr__(self):
return str(self.__dict__)
def __eq__(self, other):
return self.hit_ms == other.hit_ms
def __post_init__(self):
for field_name in [f.name for f in fields(Note)]:
if hasattr(self._source_note, field_name):