egl: drop another indentation level in _eglFindDisplay() by inverting an if
Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6361>
This commit is contained in:

committed by
Marge Bot

parent
8b2fc1d1b5
commit
0dc0a79a58
@@ -261,26 +261,28 @@ _eglFindDisplay(_EGLPlatformType plat, void *plat_dpy,
|
||||
/* create a new display */
|
||||
assert(!disp);
|
||||
disp = calloc(1, sizeof(_EGLDisplay));
|
||||
if (disp) {
|
||||
mtx_init(&disp->Mutex, mtx_plain);
|
||||
disp->Platform = plat;
|
||||
disp->PlatformDisplay = plat_dpy;
|
||||
num_attribs = _eglNumAttribs(attrib_list);
|
||||
if (num_attribs) {
|
||||
disp->Options.Attribs = calloc(num_attribs, sizeof(EGLAttrib));
|
||||
if (!disp->Options.Attribs) {
|
||||
free(disp);
|
||||
disp = NULL;
|
||||
goto out;
|
||||
}
|
||||
memcpy(disp->Options.Attribs, attrib_list,
|
||||
num_attribs * sizeof(EGLAttrib));
|
||||
if (!disp)
|
||||
goto out;
|
||||
|
||||
mtx_init(&disp->Mutex, mtx_plain);
|
||||
disp->Platform = plat;
|
||||
disp->PlatformDisplay = plat_dpy;
|
||||
num_attribs = _eglNumAttribs(attrib_list);
|
||||
if (num_attribs) {
|
||||
disp->Options.Attribs = calloc(num_attribs, sizeof(EGLAttrib));
|
||||
if (!disp->Options.Attribs) {
|
||||
free(disp);
|
||||
disp = NULL;
|
||||
goto out;
|
||||
}
|
||||
/* add to the display list */
|
||||
disp->Next = _eglGlobal.DisplayList;
|
||||
_eglGlobal.DisplayList = disp;
|
||||
memcpy(disp->Options.Attribs, attrib_list,
|
||||
num_attribs * sizeof(EGLAttrib));
|
||||
}
|
||||
|
||||
/* add to the display list */
|
||||
disp->Next = _eglGlobal.DisplayList;
|
||||
_eglGlobal.DisplayList = disp;
|
||||
|
||||
out:
|
||||
mtx_unlock(_eglGlobal.Mutex);
|
||||
|
||||
|
Reference in New Issue
Block a user