Skip to content

Commit

Permalink
Simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Jan 29, 2024
1 parent ec8ab16 commit fadef87
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions balancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ def __init__(self, day_of_year: int = None, data: dict = None):
self.add_day(day_of_year, data)

def add_day(self, day_of_year: int, data: dict):
existing = self.get_day(day_of_year)
if existing is None:
if self.get_day(day_of_year) is None:
data['day'] = day_of_year
if len(self.days) > 2:
self.days = sorted(self.days, key=lambda item: item['day'], reverse=True) # desc
Expand Down

0 comments on commit fadef87

Please sign in to comment.