summaryrefslogtreecommitdiff
path: root/engine/src
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2023-12-29 00:05:03 -0500
committerMicha White <botahamec@outlook.com>2023-12-29 00:05:03 -0500
commita3794530958ccd8bc6d8a7ed90edf3d1fd91bc54 (patch)
treec66cbfc39717a97b24071cec6de9194b90b0be96 /engine/src
parent07533a3b871baf3a202a4014fc2bd7b5cc2510a3 (diff)
Actually update self.sorted
Diffstat (limited to 'engine/src')
-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)