[smuxi/experiments/tag_messages: 39/41] Frontend-GNOME: fix sync progress bar



commit 48299bcc94f1c028cb38beb3aa1b7ba71f35a3d0
Author: Mirco Bauer <meebey meebey net>
Date:   Tue Feb 23 15:58:48 2016 +0100

    Frontend-GNOME: fix sync progress bar
    
    We need to use IEnumerable.Count() instead of IEnumerable.Select(), because
    .Select() behaves like Map() and returns a new list of the returned values for
    each item of the original list.

 src/Frontend-GNOME/MainWindow.cs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/Frontend-GNOME/MainWindow.cs b/src/Frontend-GNOME/MainWindow.cs
index 9b2faae..1d2b2a4 100644
--- a/src/Frontend-GNOME/MainWindow.cs
+++ b/src/Frontend-GNOME/MainWindow.cs
@@ -647,7 +647,7 @@ namespace Smuxi.Frontend.Gnome
         {
             var chats = ChatViewManager.Chats;
             var totalChatCount = chats.Count;
-            var syncedChatCount = chats.Select(x => x.IsSynced).Count();
+            var syncedChatCount = chats.Count(x => x.IsSynced);
             var fraction = (double) syncedChatCount / totalChatCount;
             if (totalChatCount == 0) {
                 // x / 0d -> Infinity


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]