Skip to content

Commit e9961db

Browse files
committed
Refactor to extract step.full_lhs_value into value variable
To avoid repeating ourselves and because "Which value?" is clear from the context of the function.
1 parent 5a594a8 commit e9961db

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/goto-programs/xml_goto_trace.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ xmlt full_lhs_value(const goto_trace_stept &step, const namespacet &ns)
3333
const irep_idt identifier =
3434
lhs_object.has_value() ? lhs_object->get_identifier() : irep_idt();
3535

36-
if(step.full_lhs_value.is_not_nil())
37-
xml.data = from_expr(ns, identifier, step.full_lhs_value);
36+
const exprt &value = step.full_lhs_value;
37+
if(value.is_not_nil())
38+
xml.data = from_expr(ns, identifier, value);
3839

39-
if(
40-
const auto &type =
41-
type_try_dynamic_cast<bitvector_typet>(step.full_lhs_value.type()))
40+
if(const auto &type = type_try_dynamic_cast<bitvector_typet>(value.type()))
4241
{
4342
const auto &constant =
44-
expr_try_dynamic_cast<constant_exprt>(step.full_lhs_value);
43+
expr_try_dynamic_cast<constant_exprt>(value);
4544
const auto width = type->get_width();
4645
const auto binary_representation =
4746
integer2binary(bvrep2integer(constant->get_value(), width, false), width);

0 commit comments

Comments
 (0)