aboutsummaryrefslogtreecommitdiff
path: root/src/grid/storage.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-07-21 17:17:41 +0000
committerGitHub <noreply@github.com>2018-07-21 17:17:41 +0000
commitf50ca1a54c94fe324d22d985c1acae1ff7c16a80 (patch)
tree7fc2e79f7dccf512fe71f841ef5434e0b1d2b5d7 /src/grid/storage.rs
parentb05ad74fe6d42ce0f913e02ef633ca119fc0b43e (diff)
downloadalacritty-f50ca1a54c94fe324d22d985c1acae1ff7c16a80.tar.gz
alacritty-f50ca1a54c94fe324d22d985c1acae1ff7c16a80.zip
Scrollback cleanup
There were some unneeded codeblocks and TODO/XXX comments in the code that have been removed. All issues marked with TODO/XXX have either been already resolved or tracking issues exist.
Diffstat (limited to 'src/grid/storage.rs')
-rw-r--r--src/grid/storage.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/grid/storage.rs b/src/grid/storage.rs
index 5d6cb936..6a453da6 100644
--- a/src/grid/storage.rs
+++ b/src/grid/storage.rs
@@ -68,12 +68,12 @@ impl<T: PartialEq> ::std::cmp::PartialEq for Storage<T> {
// Smaller Zero (3):
// 7 8 9 | 0 1 2 3 | 4 5 6
// C3 C3 C3 | C1 C1 C1 C1 | C2 C2 C2
- &bigger.inner[bigger_zero..]
- == &smaller.inner[smaller_zero..smaller_zero + (len - bigger_zero)]
- && &bigger.inner[..bigger_zero - smaller_zero]
- == &smaller.inner[smaller_zero + (len - bigger_zero)..]
- && &bigger.inner[bigger_zero - smaller_zero..bigger_zero]
- == &smaller.inner[..smaller_zero]
+ bigger.inner[bigger_zero..]
+ == smaller.inner[smaller_zero..smaller_zero + (len - bigger_zero)]
+ && bigger.inner[..bigger_zero - smaller_zero]
+ == smaller.inner[smaller_zero + (len - bigger_zero)..]
+ && bigger.inner[bigger_zero - smaller_zero..bigger_zero]
+ == smaller.inner[..smaller_zero]
}
}
@@ -84,11 +84,8 @@ impl<T> Storage<T> {
T: Clone,
{
// Allocate all lines in the buffer, including scrollback history
- //
- // TODO (jwilm) Allocating each line at this point is expensive and
- // delays startup. A nice solution might be having `Row` delay
- // allocation until it's actually used.
let inner = vec![template; cap];
+
Storage {
inner,
zero: 0,
@@ -124,7 +121,7 @@ impl<T> Storage<T> {
}
/// Grow the number of lines in the buffer, filling new lines with the template
- pub fn grow_lines(&mut self, growage: usize, template_row: Row<T>)
+ fn grow_lines(&mut self, growage: usize, template_row: Row<T>)
where
T: Clone,
{
@@ -225,9 +222,6 @@ impl<T> Storage<T> {
/// The default implementation from swap generates 8 movups and 4 movaps
/// instructions. This implementation achieves the swap in only 8 movups
/// instructions.
- ///
- // TODO Once specialization is available, Storage<T> can be fully generic
- // again instead of enforcing inner: Vec<Row<T>>.
pub fn swap(&mut self, a: usize, b: usize) {
debug_assert!(::std::mem::size_of::<Row<T>>() == 32);