Skip to content

Commit 8151e91

Browse files
author
Daniel Kroening
authored
Merge pull request diffblue#1429 from janmroczkowski/janmroczkowski/unified_difft-remove-unused-identifier
Remove unused identifier
2 parents 3ceb89b + f948c2f commit 8151e91

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

src/goto-diff/unified_diff.cpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,13 @@ void unified_difft::get_diff(
5454
new_fit->second.body;
5555

5656
get_diff(
57-
function,
5857
old_goto_program,
5958
new_goto_program,
6059
entry->second,
6160
dest);
6261
}
6362

6463
void unified_difft::get_diff(
65-
const irep_idt &identifier,
6664
const goto_programt &old_goto_program,
6765
const goto_programt &new_goto_program,
6866
const differencest &differences,
@@ -109,7 +107,6 @@ void unified_difft::output_diff(
109107
{
110108
goto_program_difft diff;
111109
get_diff(
112-
identifier,
113110
old_goto_program,
114111
new_goto_program,
115112
differences,
@@ -387,15 +384,26 @@ void unified_difft::output(std::ostream &os) const
387384

388385
for(const std::pair<irep_idt, differencest> &p : differences_map)
389386
{
390-
goto_functionst::function_mapt::const_iterator f1=
391-
old_goto_functions.function_map.find(p.first);
392-
goto_functionst::function_mapt::const_iterator f2=
393-
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;
394402

395403
output_diff(
396-
p.first,
397-
f1==old_goto_functions.function_map.end()?empty:f1->second.body,
398-
f2==new_goto_functions.function_map.end()?empty:f2->second.body,
404+
function,
405+
old_goto_program,
406+
new_goto_program,
399407
p.second,
400408
os);
401409
}

src/goto-diff/unified_diff.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ class unified_difft
7676
differencest &differences) const;
7777

7878
void get_diff(
79-
const irep_idt &identifier,
8079
const goto_programt &old_goto_program,
8180
const goto_programt &new_goto_program,
8281
const differencest &differences,

0 commit comments

Comments
 (0)