]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/tui] Simplify tui_enable
authorTom de Vries <tdevries@suse.de>
Fri, 1 May 2026 16:46:09 +0000 (18:46 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 1 May 2026 16:46:09 +0000 (18:46 +0200)
commitdfbb704fa390c789c66c99f000ea0cdfdb8aab1c
treef41b4a9167a418b53872652d66fe699f7d410e5b
parent60f1332264439b1605ad8b12382d4d472b8d7900
[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 <tom@tromey.com>
[1] https://llvm.org/docs/CodingStandards.html#id41
gdb/tui/tui.c