diff options
Diffstat (limited to 'src/grid/storage.rs')
-rw-r--r-- | src/grid/storage.rs | 5 |
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> { |