git.delta.rocks / jrsonnet / refs/commits / 2e73cc7107f6

difftreelog

perf do not fill assertions_ran map without asserts

Yaroslav Bolyukin2022-12-12parent: #5da470f.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
472 }472 }
473473
474 fn run_assertions_raw(&self, real_this: &Self) -> Result<()> {474 fn run_assertions_raw(&self, real_this: &Self) -> Result<()> {
475 if self.0.assertions.is_empty() {
476 if let Some(super_obj) = &self.0.sup {
477 super_obj.run_assertions_raw(real_this)?;
478 }
479 return Ok(());
480 }
475 if self.0.assertions_ran.borrow_mut().insert(real_this.clone()) {481 if self.0.assertions_ran.borrow_mut().insert(real_this.clone()) {
476 for assertion in self.0.assertions.iter() {482 for assertion in self.0.assertions.iter() {
477 if let Err(e) = assertion.run(self.0.sup.clone(), Some(real_this.clone())) {483 if let Err(e) = assertion.run(self.0.sup.clone(), Some(real_this.clone())) {