[gtk+] a11y: Implement find_cell_info() using qdata lookup
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] a11y: Implement find_cell_info() using qdata lookup
- Date: Wed, 16 Nov 2011 03:41:24 +0000 (UTC)
commit 71011f3e1eb9fad5bd38af756fa34d764319afb0
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 11 20:11:50 2011 +0100
a11y: Implement find_cell_info() using qdata lookup
That should be orders of magnitude faster then iterating over a hash
table.
gtk/a11y/gtktreeviewaccessible.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c
index cd0390b..c27b5ee 100644
--- a/gtk/a11y/gtktreeviewaccessible.c
+++ b/gtk/a11y/gtktreeviewaccessible.c
@@ -3605,16 +3605,14 @@ find_cell_info (GtkTreeViewAccessible *accessible,
gboolean live_only)
{
GtkTreeViewAccessibleCellInfo *cell_info;
- GHashTableIter iter;
- /* Clean GtkTreeViewAccessibleCellInfo data */
- g_hash_table_iter_init (&iter, accessible->cell_info_by_index);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &cell_info))
- {
- if (cell_info->cell == cell && (!live_only || cell_info->in_use))
- return cell_info;
- }
- return NULL;
+ cell_info = g_object_get_qdata (G_OBJECT (cell),
+ gtk_tree_view_accessible_get_data_quark ());
+
+ if (live_only && cell_info && !cell_info->in_use)
+ cell_info = NULL;
+
+ return cell_info;
}
static AtkObject *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]