From 1413a09f346f7b0765b303f7770ec597c78bff2f Mon Sep 17 00:00:00 2001 From: Quanxian Wang Date: Wed, 18 Dec 2013 22:11:00 -0700 Subject: egl: break instead of looping after driver is found Stop searching for a driver after success. Signed-off-by: Quanxian Wang Reviewed-By: Gong, Zhigang Reviewed-by: Brian Paul --- src/egl/drivers/dri2/egl_dri2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/egl/drivers/dri2/egl_dri2.c') diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e703f282c92..892f1f4def7 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -403,6 +403,9 @@ dri2_open_driver(_EGLDisplay *disp) if (dri2_dpy->driver == NULL) _eglLog(_EGL_DEBUG, "failed to open %s: %s\n", path, dlerror()); } + /* not need continue to loop all paths once the driver is found */ + if (dri2_dpy->driver != NULL) + break; } if (dri2_dpy->driver == NULL) { -- cgit v1.2.3