egl: fold _eglError() + return EGL_FALSE
[mesa.git] / src / egl / main / egldisplay.c
index 6eeaa35eb6375fece471a096c0e20e8835e0f19e..7aaab3c2c94fc8e9e403c4ad22b83e2e1dc328db 100644 (file)
@@ -495,12 +495,10 @@ _eglParseX11DisplayAttribList(_EGLDisplay *display, const EGLint *attrib_list)
       /* EGL_EXT_platform_x11 recognizes exactly one attribute,
        * EGL_PLATFORM_X11_SCREEN_EXT, which is optional.
        */
-      if (attrib == EGL_PLATFORM_X11_SCREEN_EXT) {
-         display->Options.Platform = (void *)(uintptr_t)value;
-      } else {
-         _eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
-         return EGL_FALSE;
-      }
+      if (attrib != EGL_PLATFORM_X11_SCREEN_EXT)
+         return _eglError(EGL_BAD_ATTRIBUTE, "eglGetPlatformDisplay");
+
+      display->Options.Platform = (void *)(uintptr_t)value;
    }
 
    return EGL_TRUE;