Skip to content

Make more member function static in unified_difft #1554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/goto-diff/unified_diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ unified_difft::get_diff(const irep_idt &function) const
unified_difft::goto_program_difft unified_difft::get_diff(
const goto_programt &old_goto_program,
const goto_programt &new_goto_program,
const differencest &differences) const
const differencest &differences)
{
goto_programt::instructionst::const_iterator old_it =
old_goto_program.instructions.begin();
Expand Down Expand Up @@ -148,7 +148,7 @@ void unified_difft::lcss(
const irep_idt &identifier,
const goto_programt &old_goto_program,
const goto_programt &new_goto_program,
differencest &differences) const
differencest &differences)
Copy link
Contributor

@reuk reuk Nov 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than modifying differences in place, would it be possible to have this return a new differencest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I will make it a separate commit and change title of the PR since this PR was only about addition of static. Would it be OK with you if I throw in a small commit about expr2javat and ask Chris to review?

{
std::size_t old_count = old_goto_program.instructions.size();
std::size_t new_count = new_goto_program.instructions.size();
Expand Down
8 changes: 4 additions & 4 deletions src/goto-diff/unified_diff.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ class unified_difft
const goto_programt &old_goto_program,
const goto_programt &new_goto_program);

void lcss(
static void lcss(
const irep_idt &identifier,
const goto_programt &old_goto_program,
const goto_programt &new_goto_program,
differencest &differences) const;
differencest &differences);

goto_program_difft get_diff(
static goto_program_difft get_diff(
const goto_programt &old_goto_program,
const goto_programt &new_goto_program,
const differencest &differences) const;
const differencest &differences);

void output_diff(
const irep_idt &identifier,
Expand Down