From: Tom de Vries Date: Fri, 1 May 2026 16:46:09 +0000 (+0200) Subject: [gdb/tui] Simplify tui_enable X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfbb704fa390c789c66c99f000ea0cdfdb8aab1c;p=thirdparty%2Fbinutils-gdb.git [gdb/tui] Simplify tui_enable I noticed some code in tui_enable doing: ... if (...) error (...); else if (...) ... which is the "Don’t use else after a return" anti-pattern [1]. Fix this by using: ... if (...) error (...); if (...) ... Approved-By: Tom Tromey [1] https://llvm.org/docs/CodingStandards.html#id41 --- diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index ba4f6f68769..de2faa36af7 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -429,7 +429,8 @@ tui_enable (void) again. */ error (_("Cannot enable the TUI")); } - else if (tui_finish_init == TRIBOOL_TRUE) + + if (tui_finish_init == TRIBOOL_TRUE) { WINDOW *w; SCREEN *s;