[gnome-games/wip/exalm/spinner: 20/25] 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: 20/25] collection-icon-view: Only call model.get_n_items() once
- Date: Sat, 9 Feb 2019 12:20:12 +0000 (UTC)
commit 8d42563c69e9337ca2eda6ea587d7a7cca7c0a3e
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]