git.delta.rocks / jrsonnet / refs/commits / d8c2588d1b33

difftreelog

fix(evaluator) remove useless stack frame for ifs

Лач2020-06-25parent: #7740ddd.patch.diff
in: master

1 file changed

modifiedcrates/jsonnet-evaluator/src/evaluate.rsdiffbeforeafterboth
775 cond_then,775 cond_then,
776 cond_else,776 cond_else,
777 } => {777 } => {
778 let condition_result = push(cond.0.clone(), "if condition".to_owned(), || {
779 evaluate(context.clone(), &cond.0)?.try_cast_bool("if condition should be boolean")
780 })?;
781 if condition_result {778 if evaluate(context, &cond.0)?.try_cast_bool("if condition should be boolean")? {
782 push(
783 cond_then.clone(),
784 "if condition 'then' branch".to_owned(),
785 || evaluate(context, cond_then),779 evaluate(context, cond_then)?
786 )?
787 } else {780 } else {
788 match cond_else {781 match cond_else {
789 Some(v) => evaluate(context, v)?,782 Some(v) => evaluate(context, v)?,