[maemo-commits] [maemo-commits] r18821 - in projects/haf/branches/gtk+/hildon-fm-optimization-test: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jul 1 16:04:41 EEST 2009
Author: kris
Date: 2009-07-01 16:04:33 +0300 (Wed, 01 Jul 2009)
New Revision: 18821

Modified:
   projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog
   projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreemodelfilter.c
Log:
2009-07-01  Kristian Rietveld  <kris at lanedo.com>

	* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_get_nth_visible):
	short circuit for levels that do not have invisible nodes.



Modified: projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog
===================================================================
--- projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog	2009-07-01 12:56:27 UTC (rev 18820)
+++ projects/haf/branches/gtk+/hildon-fm-optimization-test/ChangeLog	2009-07-01 13:04:33 UTC (rev 18821)
@@ -1,5 +1,10 @@
 2009-07-01  Kristian Rietveld  <kris at lanedo.com>
 
+	* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_get_nth_visible):
+	short circuit for levels that do not have invisible nodes.
+
+2009-07-01  Kristian Rietveld  <kris at lanedo.com>
+
 	Mark branchpoint for hildon-fm-optimization-test.
 
 2009-07-01  Kristian Rietveld  <kris at lanedo.com>

Modified: projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreemodelfilter.c
===================================================================
--- projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreemodelfilter.c	2009-07-01 12:56:27 UTC (rev 18820)
+++ projects/haf/branches/gtk+/hildon-fm-optimization-test/gtk/gtktreemodelfilter.c	2009-07-01 13:04:33 UTC (rev 18821)
@@ -833,6 +833,10 @@
   if (level->visible_nodes <= n)
     return NULL;
 
+  /* Short ciruit if this level does not have invisible nodes. */
+  if (level->visible_nodes == level->array->len)
+    return gtk_tree_model_filter_get_nth (filter, level, n);
+
   elt = FILTER_ELT (level->array->data);
   while (!elt->visible)
     elt++;

More information about the maemo-commits mailing list