Skip to content

Commit

Permalink
Don't overwrite results[1].counter
Browse files Browse the repository at this point in the history
Likely a change made while developing that I forgot to remove.
  • Loading branch information
jcxldn committed Mar 9, 2023
1 parent 3729600 commit eed421b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions xbox/webapi/common/ratelimits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,7 @@ def increment(self) -> IncrementResult:
result = limit.increment()
results.append(result)

# SPEC: Which counter should be picked here?
# For now, let's pick the *higher* counter
# (should incrementResult even include the counter?)
results[1].counter = 5

# SPEC: Let's pick the *higher* counter
# By default, sorted() returns in ascending order, so let's set reverse=True
# This means that the result with the highest counter will be the first element.
results_sorted = sorted(results, key=lambda i: i.counter, reverse=True)
Expand Down

0 comments on commit eed421b

Please sign in to comment.