deduplicate route history

This commit is contained in:
Evan Almloff committed 2023-08-01 10:16:19 -07:00
1 parent 39e89c1fac
commit 98de423d99
2 files changed
+14

No files matched your search

+4
View File
@@ -88,6 +88,10 @@ impl<R: Routable> HistoryProvider<R> for MemoryHistory<R> {
}
fn push(&mut self, new: R) {
// don't push the same route twice
if self.current.to_string() == new.to_string() {
return;
}
let old = std::mem::replace(&mut self.current, new);
self.history.push(old);
self.future.clear();