[gnome-games/wip/exalm/spinner: 17/17] collection-icon-view: Only call model.get_n_items() once



commit cf53cb4cd568f04ef81c1d1397c8f799af67ee08
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sun Sep 30 13:17:22 2018 +0500

    collection-icon-view: Only call model.get_n_items() once
    
    This saves some time when binding model.

 src/ui/collection-icon-view.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/ui/collection-icon-view.vala b/src/ui/collection-icon-view.vala
index f5e7e0d4..082dd630 100644
--- a/src/ui/collection-icon-view.vala
+++ b/src/ui/collection-icon-view.vala
@@ -43,7 +43,8 @@ private class Games.CollectionIconView : Gtk.Bin {
                        if (model == null)
                                return;
 
-                       for (int i = 0; i < model.get_n_items (); i++) {
+                       uint n_items = model.get_n_items ();
+                       for (uint i = 0; i < n_items; i++) {
                                var game = model.get_item (i) as Game;
                                add_game (game);
                        }


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