Skip to content

Commit a4a9475

Browse files
author
Daniel Kroening
committed
optimize for case of one match in class hierarchy
1 parent ea78fc7 commit a4a9475

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/goto-programs/remove_virtual_functions.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ void remove_virtual_functionst::remove_virtual_function(
148148
target->make_skip();
149149
return; // give up
150150
}
151+
152+
// only one option?
153+
if(functions.size()==1)
154+
{
155+
assert(target->is_function_call());
156+
to_code_function_call(target->code).function()=
157+
functions.begin()->symbol_expr;
158+
159+
return;
160+
}
151161

152162
// the final target is a skip
153163
goto_programt final_skip;

0 commit comments

Comments
 (0)