Skip to content

Commit

Permalink
Merge pull request #637 from powdr-labs/skip_diff
Browse files Browse the repository at this point in the history
Skip diff computation if not needed.
  • Loading branch information
lvella authored Sep 26, 2023
2 parents 4a55a54 + 85acb68 commit 890c10d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ast/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use itertools::Itertools;
use log::log_enabled;
use number::FieldElement;
use parsed::{BinaryOperator, UnaryOperator};
use std::fmt::{Display, Result, Write};
Expand All @@ -25,8 +26,8 @@ impl DiffMonitor {
std::mem::swap(&mut self.previous, &mut self.current);
self.current = Some(s.to_string());

if let Some(current) = &self.current {
if let Some(previous) = &self.previous {
if log_enabled!(log::Level::Trace) {
if let (Some(current), Some(previous)) = (&self.current, &self.previous) {
for diff in diff::lines(previous, current) {
match diff {
diff::Result::Left(l) => log::trace!("-{}", l),
Expand Down

0 comments on commit 890c10d

Please sign in to comment.