Skip to content

Commit

Permalink
refactor(eval): remove State::FinishObject, which is a duplicate of…
Browse files Browse the repository at this point in the history
… `State::ObjectToValue`
  • Loading branch information
eduardosm committed Nov 4, 2024
1 parent e3ceda6 commit 45bfbe8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion rsjsonnet-lang/src/program/eval/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl<'p> Evaluator<'_, 'p> {
asserts_checked: Cell::new(false),
});

self.state_stack.push(State::FinishObject);
self.state_stack.push(State::ObjectToValue);

for field in ir_fields.iter().rev() {
match field.name {
Expand Down
6 changes: 0 additions & 6 deletions rsjsonnet-lang/src/program/eval/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,6 @@ impl<'p, 'a> Evaluator<'a, 'p> {
}));
}
}
State::FinishObject => {
let object = self.object_stack.pop().unwrap();
let object = self.program.gc_alloc(object);

self.value_stack.push(ValueData::Object(object));
}
State::InitCompSpec {
var_name,
value,
Expand Down
1 change: 0 additions & 1 deletion rsjsonnet-lang/src/program/eval/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ pub(super) enum State<'a, 'p> {
value: &'p ir::Expr<'p>,
base_env: Option<Gc<ThunkEnv<'p>>>,
},
FinishObject,
Field {
span: SpanId,
field_name: InternedStr<'p>,
Expand Down

0 comments on commit 45bfbe8

Please sign in to comment.