[Mesa-dev] [PATCH 27/30] egl/dri2: micro optimise dri2_bind_extensions()

Emil Velikov emil.l.velikov at gmail.com
Thu Aug 25 16:18:49 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

Do not loop over all matches if we've already found one.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/egl/drivers/dri2/egl_dri2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 3ec2c53..e638fc9 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -413,6 +413,7 @@ dri2_bind_extensions(struct dri2_egl_display *dri2_dpy,
             *(const __DRIextension **) field = extensions[i];
             _eglLog(_EGL_INFO, "found extension %s version %d",
                     extensions[i]->name, extensions[i]->version);
+            break;
          }
       }
    }
-- 
2.9.0



More information about the mesa-dev mailing list