egl/dri2: micro optimise dri2_bind_extensions()
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 25 Aug 2016 08:51:54 +0000 (09:51 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 14 Oct 2016 11:46:09 +0000 (12:46 +0100)
Do not loop over all matches if we've already found one.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
src/egl/drivers/dri2/egl_dri2.c

index dfc6f0bc22a2914b8cbe1baccea1fb43cf1eba61..c8dfa072be92fc4a1f791d38657b3a34498ffb1b 100644 (file)
@@ -422,6 +422,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;
          }
       }
    }