gl: Avoid pointless iteration

This commit is contained in:
Matthias Clasen 2019-10-22 02:28:33 -04:00
parent dd316c8051
commit 472d8eebbe

View File

@ -554,21 +554,12 @@ gsk_gl_driver_get_texture_for_pointer (GskGLDriver *self,
if (id != 0)
{
GHashTableIter iter;
gpointer value_p;
/* Find the texture in self->textures and mark it used */
Texture *t;
g_hash_table_iter_init (&iter, self->textures);
while (g_hash_table_iter_next (&iter, NULL, &value_p))
{
Texture *t = value_p;
t = g_hash_table_lookup (self->textures, GINT_TO_POINTER (id));
if (t->texture_id == id)
{
t->in_use = TRUE;
break;
}
}
if (t != NULL)
t->in_use = TRUE;
}
return id;