aboutsummaryrefslogtreecommitdiff
path: root/src/grid/storage.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2018-02-11 10:07:33 -0800
committerJoe Wilm <joe@jwilm.com>2018-06-02 09:24:38 -0700
commit92b11cfa43c3a5d32b461e43975146b27eb71ccd (patch)
treedd7e7a7ae7723a39bfa7585f8366ef851b49048a /src/grid/storage.rs
parentf13685918ff42c3a919f8a84fea64a144979d13a (diff)
downloadalacritty-92b11cfa43c3a5d32b461e43975146b27eb71ccd.tar.gz
alacritty-92b11cfa43c3a5d32b461e43975146b27eb71ccd.zip
Minor improvements
Diffstat (limited to 'src/grid/storage.rs')
-rw-r--r--src/grid/storage.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/grid/storage.rs b/src/grid/storage.rs
index f5c2d87e..49f3d26c 100644
--- a/src/grid/storage.rs
+++ b/src/grid/storage.rs
@@ -68,6 +68,11 @@ impl<T> Storage<T> {
assert!(count.abs() as usize <= len);
self.zero += (count + len as isize) as usize % len;
}
+
+ // Fast path
+ pub fn rotate_up(&mut self, count: usize) {
+ self.zero = (self.zero + count) % self.len();
+ }
}
impl<T> Index<usize> for Storage<T> {