ok/jj
1
0
Fork 0
forked from mirrors/jj

formatter: avoid updating unchanged self.current_color

This commit is contained in:
Martin von Zweigbergk 2023-01-02 16:53:35 -08:00 committed by Martin von Zweigbergk
parent 8db8da5990
commit 4b80c259cf

View file

@ -254,8 +254,8 @@ impl<W: Write> Formatter for ColorFormatter<W> {
let new_color = self.current_color();
if new_color != self.current_color {
self.output.write_all(&new_color)?;
self.current_color = new_color;
}
self.current_color = new_color;
Ok(())
}
@ -264,8 +264,8 @@ impl<W: Write> Formatter for ColorFormatter<W> {
let new_color = self.current_color();
if new_color != self.current_color {
self.output.write_all(&new_color)?;
self.current_color = new_color;
}
self.current_color = new_color;
Ok(())
}
}