diff --git a/packages/neon/neon_news/lib/sort/folders.dart b/packages/neon/neon_news/lib/sort/folders.dart index 2797a079..b769ad8b 100644 --- a/packages/neon/neon_news/lib/sort/folders.dart +++ b/packages/neon/neon_news/lib/sort/folders.dart @@ -21,9 +21,4 @@ class FolderFeedsWrapper { final List feeds; } -int feedsUnreadCountSum(final List feeds) => [ - 0, // Fixes error when no feeds are in the folder - ...feeds.map((final f) => f.unreadCount!), - ].reduce( - (final a, final b) => a + b, - ); +int feedsUnreadCountSum(final List feeds) => feeds.fold(0, (final a, final b) => a + b.unreadCount!);