Skip to content

You avoid unnecessary iterations over the list when accessing the counts. #5

@aykut-aktas-covergo

Description

@aykut-aktas-covergo

...\src\AdsPush.Abstraction\Firebase\FirebaseNotificationBatchResult.cs

By calculating the counts in the constructor and storing them directly in separate properties (SuccessCount and FailedCount),
you avoid unnecessary iterations over the list when accessing the counts.
This can help improve the performance, especially if the list of NotificationResults is large.

///


/// The notification count that is
/// successfully accepted by FCM.
///

public int SuccessCount => this.NotificationResults.Count(x => x.IsSuccess);

///


/// The notification count that is NOT accepted by FCM.
///

public int FailedCount => this.NotificationResults.Count(x => !x.IsSuccess);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions