aboutsummaryrefslogtreecommitdiffstats
path: root/src/attrs.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-10 06:17:09 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-10 08:08:14 -0500
commit168a91a9ddc331cd3b8e5c32f7701f2b0973b147 (patch)
tree6b2df47bf18a731a9814bb875ce231e28cad1bf0 /src/attrs.rs
parentb04c0e6e97765aeb888479c5e0bc27d54de60659 (diff)
downloadvt100-rust-168a91a9ddc331cd3b8e5c32f7701f2b0973b147.tar.gz
vt100-rust-168a91a9ddc331cd3b8e5c32f7701f2b0973b147.zip
optimize attribute setting a bit
Diffstat (limited to 'src/attrs.rs')
-rw-r--r--src/attrs.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/attrs.rs b/src/attrs.rs
index dc46646..4b78771 100644
--- a/src/attrs.rs
+++ b/src/attrs.rs
@@ -94,13 +94,13 @@ impl Attrs {
contents: &mut Vec<u8>,
other: &Self,
) {
- let attrs = crate::term::Attrs::default();
-
if self != other && self == &Self::default() {
- write!(contents, "{}", attrs).unwrap();
+ write!(contents, "{}", crate::term::ClearAttrs::new()).unwrap();
return;
}
+ let attrs = crate::term::Attrs::default();
+
let attrs = if self.fgcolor == other.fgcolor {
attrs
} else {