Skip to content

Commit

Permalink
Reuse group vec
Browse files Browse the repository at this point in the history
  • Loading branch information
twe4ked committed Apr 19, 2020
1 parent 35d3b0d commit 978b926
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ pub fn squash(components: Vec<Component>) -> Vec<Component> {
Component::Style(style::Style::Reset(_c)) => {
// End group
group = filter(group);

group.push(component);
ret.append(&mut group);
group = Vec::new();
group.clear();
}

Component::Style(style::Style::Color(_c)) => {
Expand All @@ -63,7 +62,7 @@ pub fn squash(components: Vec<Component>) -> Vec<Component> {
// If we're already in a group, let's end the current one, and start a new one.
if !group.is_empty() {
ret.append(&mut group);
group = Vec::new();
group.clear();
}
}

Expand Down

0 comments on commit 978b926

Please sign in to comment.