Skip to content

Commit e0599f9

Browse files
mingi3314lahirumarambajonathanedey
authored
refactor: Optimize success count calculation in BatchResponse (#837)
Co-authored-by: Lahiru Maramba <llahiru@gmail.com> Co-authored-by: Jonathan Edey <145066863+jonathanedey@users.noreply.github.com>
1 parent f7546f5 commit e0599f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firebase_admin/messaging.py

Lines changed: 1 addition & 1 deletion
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)