Skip to content

Commit 0249517

Browse files
author
Daniel Kroening
committed
consolidate the two variants of show-goto-functions
1 parent b821258 commit 0249517

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

src/goto-programs/show_goto_functions.cpp

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,32 +52,28 @@ void show_goto_functions(
5252
break;
5353

5454
case ui_message_handlert::uit::PLAIN:
55-
if(list_only)
5655
{
5756
for(const auto &fun : goto_functions.function_map)
5857
{
5958
const symbolt &symbol = ns.lookup(fun.first);
60-
msg.status() << '\n'
61-
<< symbol.display_name() << " /* " << symbol.name
62-
<< (fun.second.body_available() ? ""
63-
: ", body not available")
64-
<< " */";
65-
msg.status() << messaget::eom;
66-
}
67-
}
68-
else
69-
{
70-
auto &out = msg.status();
71-
for(const auto &fun : goto_functions.function_map)
72-
{
73-
if(fun.second.body_available())
59+
60+
if(list_only)
61+
{
62+
msg.status() << '\n'
63+
<< symbol.display_name() << " /* " << symbol.name
64+
<< (fun.second.body_available() ? ""
65+
: ", body not available")
66+
<< " */";
67+
msg.status() << messaget::eom;
68+
}
69+
else if(fun.second.body_available())
7470
{
75-
out << "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n";
71+
msg.status() << "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n";
7672

7773
const symbolt &symbol = ns.lookup(fun.first);
78-
out << messaget::bold << symbol.display_name() << messaget::reset
79-
<< " /* " << symbol.name << " */\n";
80-
fun.second.body.output(ns, symbol.name, out);
74+
msg.status() << messaget::bold << symbol.display_name() << messaget::reset
75+
<< " /* " << symbol.name << " */\n";
76+
fun.second.body.output(ns, symbol.name, msg.status());
8177
msg.status() << messaget::eom;
8278
}
8379
}

0 commit comments

Comments
 (0)