Skip to content

Commit 4935a90

Browse files
Optimize remove_level_2
Instead of building the identifier from scratch, just remove the l2 suffix.
1 parent 6758aa2 commit 4935a90

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/util/ssa_expr.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,8 @@ std::pair<irep_idt, irep_idt> ssa_exprt::build_identifier(
9999
void ssa_exprt::remove_level_2()
100100
{
101101
remove(ID_L2);
102-
update_identifier();
102+
const std::string &identifier = id2string(get_identifier());
103+
auto index = identifier.find_last_of('#');
104+
if(index != std::string::npos)
105+
set_identifier(identifier.substr(0, index));
103106
}

0 commit comments

Comments
 (0)