mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 06:21:14 +00:00
a11y: Implement find_cell_info() using qdata lookup
That should be orders of magnitude faster then iterating over a hash table.
This commit is contained in:
parent
331a4c92b0
commit
71011f3e1e
@ -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 *
|
||||
|
Loading…
Reference in New Issue
Block a user