Remove unnecessary calls to is_mi_like_p in print_thread_info_1
authorSimon Marchi <simon.marchi@ericsson.com>
Sat, 9 Sep 2017 20:51:58 +0000 (22:51 +0200)
committerSimon Marchi <simon.marchi@ericsson.com>
Sat, 9 Sep 2017 20:51:58 +0000 (22:51 +0200)
There are two calls to uiout->is_mi_like_p in the else branch of a
if (uiout->is_mi_like_p ()), we already know they will return false.

A bit lower, there are two if (!uiout->is_mi_like_p ()) that we can
merge.

gdb/ChangeLog:

* thread.c (print_thread_info_1): Remove unnecessary calls to
uiout->is_mi_like_p.

gdb/ChangeLog
gdb/thread.c

index 1bcc95a3cda9c5c6eaebbcc104f665352b5d4257..e8c69f5ba69537de65a1c0386d67ef5a670161f6 100644 (file)
@@ -1,3 +1,8 @@
+2017-09-09  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * thread.c (print_thread_info_1): Remove unnecessary calls to
+       uiout->is_mi_like_p.
+
 2017-09-09  Tom Tromey  <tom@tromey.com>
 
        * namespace.h (add_using_directive): Update.
index af7900df5ca989214d33c249dc17f392b2c87889..2539d4331469af6fd5918dbaae1b2fb2d0a31507 100644 (file)
@@ -1276,16 +1276,12 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
            return;
          }
 
-       table_emitter.emplace (uiout,
-                              (show_global_ids || uiout->is_mi_like_p ())
-                              ? 5 : 4,
+       table_emitter.emplace (uiout, show_global_ids ? 5 : 4,
                               n_threads, "threads");
 
        uiout->table_header (1, ui_left, "current", "");
-
-       if (!uiout->is_mi_like_p ())
-         uiout->table_header (4, ui_left, "id-in-tg", "Id");
-       if (show_global_ids || uiout->is_mi_like_p ())
+       uiout->table_header (4, ui_left, "id-in-tg", "Id");
+       if (show_global_ids)
          uiout->table_header (4, ui_left, "id", "GId");
        uiout->table_header (17, ui_left, "target-id", "Target Id");
        uiout->table_header (1, ui_left, "frame", "Frame");
@@ -1311,10 +1307,9 @@ print_thread_info_1 (struct ui_out *uiout, char *requested_threads,
              uiout->field_string ("current", "*");
            else
              uiout->field_skip ("current");
-         }
 
-       if (!uiout->is_mi_like_p ())
-         uiout->field_string ("id-in-tg", print_thread_id (tp));
+           uiout->field_string ("id-in-tg", print_thread_id (tp));
+         }
 
        if (show_global_ids || uiout->is_mi_like_p ())
          uiout->field_int ("id", tp->global_num);
This page took 0.060117 seconds and 4 git commands to generate.