1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-19 18:57:59 +03:00

optimize Pane::get_lines_with_hyperlinks_applied for empty rules case

It's ~30x cheaper to just get the underlying lines when there
are no hyperlink rules defined (3us vs 112us)
This commit is contained in:
Wez Furlong 2022-08-23 17:20:46 -07:00
parent 03246fba23
commit e05b3581b8

View File

@ -317,6 +317,9 @@ pub trait Pane: Downcast {
lines: Range<StableRowIndex>,
rules: &[Rule],
) -> (StableRowIndex, Vec<Line>) {
if rules.is_empty() {
return self.get_lines(lines);
}
let requested_first = lines.start;
let num_lines = (lines.end - lines.start) as usize;
let logical = self.get_logical_lines(lines);