Skip to content

Commit e6174e4

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 98f139d commit e6174e4

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,14 +33,13 @@ 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_nil())
36+
const exprt &value = step.full_lhs_value;
37+
if(value.is_nil())
3738
return value_xml;
38-
value_xml.data = from_expr(ns, identifier, step.full_lhs_value);
39+
value_xml.data = from_expr(ns, identifier, value);
3940

40-
const auto &bv_type =
41-
type_try_dynamic_cast<bitvector_typet>(step.full_lhs_value.type());
42-
const auto &constant =
43-
expr_try_dynamic_cast<constant_exprt>(step.full_lhs_value);
41+
const auto &bv_type = type_try_dynamic_cast<bitvector_typet>(value.type());
42+
const auto &constant = expr_try_dynamic_cast<constant_exprt>(value);
4443
if(bv_type && constant)
4544
{
4645
const auto width = bv_type->get_width();

0 commit comments

Comments
 (0)