Skip to content

Commit

Permalink
refactor: Optimize success count calculation in BatchResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
mingi3314 committed Dec 6, 2024
1 parent 1b131f0 commit 276fd53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firebase_admin/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ class BatchResponse:

def __init__(self, responses):
self._responses = responses
self._success_count = len([resp for resp in responses if resp.success])
self._success_count = sum(1 for resp in responses if resp.success)

@property
def responses(self):
Expand Down

0 comments on commit 276fd53

Please sign in to comment.