We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 64dec22 + 6b3986f commit e702522Copy full SHA for e702522
src/stacked_borrows.rs
@@ -559,16 +559,9 @@ impl<'tcx> Stack {
559
self.len()
560
};
561
562
- // Put the new item there. As an optimization, deduplicate if it is equal to one of its new neighbors.
563
- // `new_idx` might be 0 if we just cleared the entire stack.
564
- if self.get(new_idx) == Some(new) || (new_idx > 0 && self.get(new_idx - 1).unwrap() == new)
565
- {
566
- // Optimization applies, done.
567
- trace!("reborrow: avoiding adding redundant item {:?}", new);
568
- } else {
569
- trace!("reborrow: adding item {:?}", new);
570
- self.insert(new_idx, new);
571
- }
+ // Put the new item there.
+ trace!("reborrow: adding item {:?}", new);
+ self.insert(new_idx, new);
572
Ok(())
573
}
574
0 commit comments