[gnome-games/wip/exalm/spinner: 9/10] collection-icon-view: Only call model.get_n_items() once
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/spinner: 9/10] collection-icon-view: Only call model.get_n_items() once
- Date: Sat, 6 Oct 2018 18:44:11 +0000 (UTC)
commit 10b80babbd5790c7e67e55bb56be3d77757121b2
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]