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



commit 3c16722fccdda546367992e97d0178a53cdb80fb
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 c7384884..55efe2c2 100644
--- a/src/ui/collection-icon-view.vala
+++ b/src/ui/collection-icon-view.vala
@@ -33,7 +33,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]