summaryrefslogtreecommitdiff
path: root/engine/src/lazysort.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/lazysort.rs')
-rw-r--r--engine/src/lazysort.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/engine/src/lazysort.rs b/engine/src/lazysort.rs
index 355509e..f028778 100644
--- a/engine/src/lazysort.rs
+++ b/engine/src/lazysort.rs
@@ -52,7 +52,8 @@ impl<T: Clone, F: Fn(&T) -> R, R: Ord, const CAPACITY: usize> LazySort<T, F, R,
pub fn get(&mut self, index: usize) -> Option<&T> {
if index >= self.sorted {
- self.sort_between(self.sorted, index)
+ self.sort_between(self.sorted, index);
+ self.sorted = index;
}
self.collection.get(index)