From 2e73cc7107f622ab9fee2ab9e4c2f6693b38080f Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 12 Dec 2022 14:20:15 +0000 Subject: [PATCH] perf: do not fill assertions_ran map without asserts --- --- a/crates/jrsonnet-evaluator/src/obj.rs +++ b/crates/jrsonnet-evaluator/src/obj.rs @@ -472,6 +472,12 @@ } fn run_assertions_raw(&self, real_this: &Self) -> Result<()> { + if self.0.assertions.is_empty() { + if let Some(super_obj) = &self.0.sup { + super_obj.run_assertions_raw(real_this)?; + } + return Ok(()); + } if self.0.assertions_ran.borrow_mut().insert(real_this.clone()) { for assertion in self.0.assertions.iter() { if let Err(e) = assertion.run(self.0.sup.clone(), Some(real_this.clone())) { -- gitstuff