Skip to content

Commit 3687790

Browse files
fixup! Define two helper functions for for_each_successor
1 parent f26c760 commit 3687790

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/solvers/refinement/string_refinement_util.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -375,18 +375,19 @@ void string_dependenciest::for_each_successor(
375375
const nodet &node,
376376
const std::function<void(const nodet &)> &f) const
377377
{
378-
if(node.kind == nodet::BUILTIN)
378+
switch(node.kind)
379379
{
380-
for_each_dependency(
381-
builtin_function_nodes[node.index],
382-
[&](const string_nodet &n) { return f(nodet(n)); });
383-
}
384-
else
385-
{
386-
INVARIANT(node.kind == nodet::STRING, "nodes are either BUILTIN or STRING");
387-
for_each_dependency(
388-
string_nodes[node.index],
389-
[&](const builtin_function_nodet &n) { return f(nodet(n)); });
380+
case nodet::BUILTIN:
381+
for_each_dependency(
382+
builtin_function_nodes[node.index],
383+
[&](const string_nodet &n) { return f(nodet(n)); });
384+
break;
385+
386+
case nodet::STRING:
387+
for_each_dependency(
388+
string_nodes[node.index],
389+
[&](const builtin_function_nodet &n) { return f(nodet(n)); });
390+
break;
390391
}
391392
}
392393

0 commit comments

Comments
 (0)