]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove unnecessary block from execute_fn_to_ui_file
authorTom Tromey <tom@tromey.com>
Sat, 18 May 2024 16:51:35 +0000 (10:51 -0600)
committerTom Tromey <tom@tromey.com>
Sat, 18 May 2024 17:00:10 +0000 (11:00 -0600)
I noticed that execute_fn_to_ui_file has an extra, unnecessary block.
This patch removes it.

gdb/top.c

index b5e77ef6b05146672bcac431d7db64af83bf9d54..4da24343a0f8fed729a3dc086e5263071cf2bd39 100644 (file)
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -609,20 +609,18 @@ execute_fn_to_ui_file (struct ui_file *file, std::function<void(void)> fn)
 
   scoped_restore save_async = make_scoped_restore (&current_ui->async, 0);
 
-  {
-    ui_out_redirect_pop redirect_popper (current_uiout, file);
-
-    scoped_restore save_stdout
-      = make_scoped_restore (&gdb_stdout, file);
-    scoped_restore save_stderr
-      = make_scoped_restore (&gdb_stderr, file);
-    scoped_restore save_stdlog
-      = make_scoped_restore (&gdb_stdlog, file);
-    scoped_restore save_stdtarg
-      = make_scoped_restore (&gdb_stdtarg, file);
-
-    fn ();
-  }
+  ui_out_redirect_pop redirect_popper (current_uiout, file);
+
+  scoped_restore save_stdout
+    = make_scoped_restore (&gdb_stdout, file);
+  scoped_restore save_stderr
+    = make_scoped_restore (&gdb_stderr, file);
+  scoped_restore save_stdlog
+    = make_scoped_restore (&gdb_stdlog, file);
+  scoped_restore save_stdtarg
+    = make_scoped_restore (&gdb_stdtarg, file);
+
+  fn ();
 }
 
 /* See top.h.  */