egl: simplify loop
authorEric Engestrom <eric.engestrom@intel.com>
Thu, 13 Dec 2018 17:35:28 +0000 (17:35 +0000)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 1 Jul 2019 18:35:22 +0000 (19:35 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Sagar Ghuge<sagar.ghuge@intel.com>
src/egl/main/egldisplay.c

index 193443e056c646ccac50454fce26a0a3d6c26265..c1e8c341ac6943fc18181eb0b804f1b37ed39654 100644 (file)
@@ -262,12 +262,10 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy,
    mtx_lock(_eglGlobal.Mutex);
 
    /* search the display list first */
-   disp = _eglGlobal.DisplayList;
-   while (disp) {
+   for (disp = _eglGlobal.DisplayList; disp; disp = disp->Next) {
       if (disp->Platform == plat && disp->PlatformDisplay == plat_dpy &&
           _eglSameAttribs(disp->Options.Attribs, attrib_list))
          break;
-      disp = disp->Next;
    }
 
    /* create a new display */