projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dd316c8
)
gl: Avoid pointless iteration
author
Matthias Clasen
<mclasen@redhat.com>
Tue, 22 Oct 2019 06:28:33 +0000
(
02:28
-0400)
committer
Matthias Clasen
<mclasen@redhat.com>
Tue, 22 Oct 2019 11:16:41 +0000
(07:16 -0400)
gsk/gl/gskgldriver.c
patch
|
blob
|
history
diff --git
a/gsk/gl/gskgldriver.c
b/gsk/gl/gskgldriver.c
index 02132fc463dd7f0e8fcfd9aebecf6921cc5d4e07..3eede927ba87688f7883d2f00cba1c90edb3a381 100644
(file)
--- a/
gsk/gl/gskgldriver.c
+++ b/
gsk/gl/gskgldriver.c
@@
-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;