Skip to content

Commit f948c2f

Browse files
author
janmroczkowski
committed
Readability improvement
1 parent fc7c615 commit f948c2f

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

src/goto-diff/unified_diff.cpp

+18-7
Original file line numberDiff line numberDiff line change
@@ -384,15 +384,26 @@ void unified_difft::output(std::ostream &os) const
384384

385385
for(const std::pair<irep_idt, differencest> &p : differences_map)
386386
{
387-
goto_functionst::function_mapt::const_iterator f1=
388-
old_goto_functions.function_map.find(p.first);
389-
goto_functionst::function_mapt::const_iterator f2=
390-
new_goto_functions.function_map.find(p.first);
387+
const irep_idt &function=p.first;
388+
389+
goto_functionst::function_mapt::const_iterator old_fit=
390+
old_goto_functions.function_map.find(function);
391+
goto_functionst::function_mapt::const_iterator new_fit=
392+
new_goto_functions.function_map.find(function);
393+
394+
const goto_programt &old_goto_program=
395+
old_fit==old_goto_functions.function_map.end() ?
396+
empty :
397+
old_fit->second.body;
398+
const goto_programt &new_goto_program=
399+
new_fit==new_goto_functions.function_map.end() ?
400+
empty :
401+
new_fit->second.body;
391402

392403
output_diff(
393-
p.first,
394-
f1==old_goto_functions.function_map.end()?empty:f1->second.body,
395-
f2==new_goto_functions.function_map.end()?empty:f2->second.body,
404+
function,
405+
old_goto_program,
406+
new_goto_program,
396407
p.second,
397408
os);
398409
}

0 commit comments

Comments
 (0)