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) if (id != 0)
{ {
GHashTableIter iter; Texture *t;
gpointer value_p;
/* Find the texture in self->textures and mark it used */
g_hash_table_iter_init (&iter, self->textures); t = g_hash_table_lookup (self->textures, GINT_TO_POINTER (id));
while (g_hash_table_iter_next (&iter, NULL, &value_p))
{
Texture *t = value_p;
if (t->texture_id == id) if (t != NULL)
{ t->in_use = TRUE;
t->in_use = TRUE;
break;
}
}
} }
return id; return id;