Skip to content

Commit

Permalink
Merge pull request #138 from lotabout/performance
Browse files Browse the repository at this point in the history
Performance Improvement
  • Loading branch information
lotabout authored Mar 17, 2019
2 parents 5350318 + 3d13d6a commit 3e36f90
Show file tree
Hide file tree
Showing 23 changed files with 2,115 additions and 2,493 deletions.
57 changes: 28 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ log = "0.3.8"
env_logger = "0.4.3"
time = "0.1.38"
clap = "2.26.2"
tuikit = "0.1.5"
tuikit = "0.2.0"
vte = "0.3.3"
skiplist = "0.2.10"
fuzzy-matcher = "0.2.0"
Expand Down
8 changes: 6 additions & 2 deletions src/ansi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ impl AnsiString {
}
}

pub fn is_empty(&self) -> bool {
self.fragments.is_empty()
}

pub fn into_inner(self) -> String {
self.stripped.into()
}
Expand All @@ -226,14 +230,14 @@ impl AnsiString {

/// An iterator over all the (char, attr) characters.
pub struct AnsiStringIterator<'a> {
fragments: &'a Vec<(Attr, Cow<'a, str>)>,
fragments: &'a [(Attr, Cow<'a, str>)],
fragment_idx: usize,
attr: Attr,
chars_iter: Option<std::str::Chars<'a>>,
}

impl<'a> AnsiStringIterator<'a> {
pub fn new(fragments: &'a Vec<(Attr, Cow<'a, str>)>) -> Self {
pub fn new(fragments: &'a [(Attr, Cow<'a, str>)]) -> Self {
Self {
fragments,
fragment_idx: 0,
Expand Down
Loading

0 comments on commit 3e36f90

Please sign in to comment.