Codechange: [Win32] Use return-early in RegisterWndClass()

This commit is contained in:
Patric Stout
2021-01-16 15:27:13 +01:00
committed by Michael Lutz
parent 7415964a4d
commit 689404a4a1

View File

@@ -975,7 +975,8 @@ static void RegisterWndClass()
{ {
static bool registered = false; static bool registered = false;
if (!registered) { if (registered) return;
HINSTANCE hinst = GetModuleHandle(nullptr); HINSTANCE hinst = GetModuleHandle(nullptr);
WNDCLASS wnd = { WNDCLASS wnd = {
CS_OWNDC, CS_OWNDC,
@@ -992,7 +993,6 @@ static void RegisterWndClass()
registered = true; registered = true;
if (!RegisterClass(&wnd)) usererror("RegisterClass failed"); if (!RegisterClass(&wnd)) usererror("RegisterClass failed");
}
} }
static bool AllocateDibSection(int w, int h, bool force) static bool AllocateDibSection(int w, int h, bool force)