Skip to content

Commit 87f971f

Browse files
committed
Revert "fix: hoist zero-point early return in _update_points, removing duplicate check"
This reverts commit d4fc24c.
1 parent b276b54 commit 87f971f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

bot/exts/levels/_cog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,11 @@ async def _refresh_sorted_thresholds(self) -> None:
196196
async def _update_points(self, user_id: int, points: int, halve_points: bool=False) -> None:
197197
"""Updates user's score and ensures correct role is assigned."""
198198
logger.debug(f"User {user_id} getting {points} points, halving override: {halve_points}.")
199-
if points == 0 and not halve_points:
200-
return
201-
202199
if not await self.user_points_cache.contains(user_id):
203200
await self.user_points_cache.set(user_id, points)
204201
else:
202+
if points == 0 and not halve_points:
203+
return
205204
current_points = cast(int, await self.user_points_cache.get(user_id, default=0))
206205
new_point_total = current_points + points
207206
if halve_points:

0 commit comments

Comments
 (0)