Skip to content

Commit 276fd53

Browse files
committed
refactor: Optimize success count calculation in BatchResponse
1 parent 1b131f0 commit 276fd53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firebase_admin/messaging.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ class BatchResponse:
323323

324324
def __init__(self, responses):
325325
self._responses = responses
326-
self._success_count = len([resp for resp in responses if resp.success])
326+
self._success_count = sum(1 for resp in responses if resp.success)
327327

328328
@property
329329
def responses(self):

0 commit comments

Comments
 (0)