mirror of https://codeberg.org/topola/topola.git
layout: Move R-tree remove out of `debug_assert`
Because of that release builds were panicking.
This commit is contained in:
parent
b1ac987d2f
commit
4ec32c97ba
|
|
@ -312,8 +312,8 @@ impl Layout {
|
||||||
self.rtree
|
self.rtree
|
||||||
.locate_in_envelope_intersecting(&shape.envelope())
|
.locate_in_envelope_intersecting(&shape.envelope())
|
||||||
.filter(|wrapper| {
|
.filter(|wrapper| {
|
||||||
let index = wrapper.data;
|
let other_index = wrapper.data;
|
||||||
!untag!(index, primitive.connectable(index))
|
!untag!(other_index, primitive.connectable(other_index))
|
||||||
})
|
})
|
||||||
.filter(|wrapper| !except.contains(&wrapper.data))
|
.filter(|wrapper| !except.contains(&wrapper.data))
|
||||||
.filter(|wrapper| shape.intersects(wrapper.geom()))
|
.filter(|wrapper| shape.intersects(wrapper.geom()))
|
||||||
|
|
@ -332,10 +332,8 @@ impl Layout {
|
||||||
#[debug_ensures(self.graph.edge_count() == old(self.graph.edge_count()))]
|
#[debug_ensures(self.graph.edge_count() == old(self.graph.edge_count()))]
|
||||||
fn remove_from_rtree(&mut self, index: TaggedIndex) {
|
fn remove_from_rtree(&mut self, index: TaggedIndex) {
|
||||||
let shape = untag!(index, self.primitive(index).shape());
|
let shape = untag!(index, self.primitive(index).shape());
|
||||||
debug_assert!(self
|
let removed_element = self.rtree.remove(&RTreeWrapper::new(shape, index));
|
||||||
.rtree
|
debug_assert!(removed_element.is_some());
|
||||||
.remove(&RTreeWrapper::new(shape, index))
|
|
||||||
.is_some());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue