[banshee] Replace couple of Count()>0 Linq usages with faster Any() API



commit 3063b4edefd2dc214f6799855d9bf8d8c9e2c56f
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Wed Mar 26 23:19:21 2014 +0100

    Replace couple of Count()>0 Linq usages with faster Any() API

 .../ColumnCellCreativeCommons.cs                   |    2 +-
 .../RecommendationPane.cs                          |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs 
b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
index ce10661..be7da09 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellCreativeCommons.cs
@@ -91,7 +91,7 @@ namespace Banshee.Collection.Gui
         public string GetTooltipMarkup (CellContext cellContext, double columnWidth)
         {
             var our_attributes = AttributesForBoundObject.Select (i => attributes_uc[i]);
-            return our_attributes.Count () > 0
+            return our_attributes.Any ()
                 ? String.Format ("Creative Commons {0}", String.Join ("-", our_attributes.ToArray ()))
                 : null;
         }
diff --git a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs 
b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs
index ec8d5dc..11f77c1 100644
--- a/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs
+++ b/src/Extensions/Banshee.Lastfm/Banshee.Lastfm.Recommendations/RecommendationPane.cs
@@ -280,7 +280,7 @@ namespace Banshee.Lastfm.Recommendations
                 // Similar Artists
                 var artists = similar_artists.Take (20);
 
-                if (artists.Count () > 0) {
+                if (artists.Any ()) {
                     int artist_name_max_len = 2 * (int) artists.Select (a => a.Name.Length).Average ();
                     foreach (var similar_artist in artists) {
                         SimilarArtistTile tile = new SimilarArtistTile (similar_artist);


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