Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): use transactional ID computation in atomically_two_sew #222

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 22 additions & 32 deletions honeycomb-core/src/cmap/dim2/link_and_sew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,21 +259,19 @@ impl<T: CoordsFloat> CMap2<T> {
self.two_link_core(trans, lhs_dart_id, rhs_dart_id)?;
// merge vertices & attributes from the old IDs to the new one
// FIXME: VertexIdentifier should be cast to DartIdentifier
self.vertices.merge_core(
trans,
self.vertex_id(lhs_dart_id),
lhs_vid_old,
b1rhs_vid_old,
)?;
let lhs_vid_new = self.vertex_id_transac(trans, lhs_dart_id)?;
let eid_new = self.edge_id_transac(trans, lhs_dart_id)?;
self.vertices
.merge_core(trans, lhs_vid_new, lhs_vid_old, b1rhs_vid_old)?;
self.attributes.merge_vertex_attributes_transac(
trans,
self.vertex_id(lhs_dart_id),
lhs_vid_new,
lhs_vid_old,
b1rhs_vid_old,
)?;
self.attributes.merge_edge_attributes_transac(
trans,
self.edge_id(lhs_dart_id),
eid_new,
lhs_eid_old,
rhs_eid_old,
)?;
Expand All @@ -288,22 +286,19 @@ impl<T: CoordsFloat> CMap2<T> {
// update the topology
self.two_link_core(trans, lhs_dart_id, rhs_dart_id)?;
// merge vertices & attributes from the old IDs to the new one
// FIXME: VertexIdentifier should be cast to DartIdentifier
self.vertices.merge_core(
trans,
self.vertex_id(rhs_dart_id),
b1lhs_vid_old,
rhs_vid_old,
)?;
let rhs_vid_new = self.vertex_id_transac(trans, rhs_dart_id)?;
let eid_new = self.edge_id_transac(trans, lhs_dart_id)?;
self.vertices
.merge_core(trans, rhs_vid_new, b1lhs_vid_old, rhs_vid_old)?;
self.attributes.merge_vertex_attributes_transac(
trans,
self.vertex_id(rhs_dart_id),
rhs_vid_new,
b1lhs_vid_old,
rhs_vid_old,
)?;
self.attributes.merge_edge_attributes_transac(
trans,
self.edge_id(lhs_dart_id),
eid_new,
lhs_eid_old,
rhs_eid_old,
)?;
Expand Down Expand Up @@ -346,33 +341,28 @@ impl<T: CoordsFloat> CMap2<T> {
self.two_link_core(trans, lhs_dart_id, rhs_dart_id)?;
// merge vertices & attributes from the old IDs to the new one
// FIXME: VertexIdentifier should be cast to DartIdentifier
self.vertices.merge_core(
trans,
self.vertex_id(lhs_dart_id),
lhs_vid_old,
b1rhs_vid_old,
)?;
self.vertices.merge_core(
trans,
self.vertex_id(rhs_dart_id),
b1lhs_vid_old,
rhs_vid_old,
)?;
let lhs_vid_new = self.vertex_id_transac(trans, lhs_dart_id)?;
let rhs_vid_new = self.vertex_id_transac(trans, rhs_dart_id)?;
let eid_new = self.edge_id_transac(trans, lhs_dart_id)?;
self.vertices
.merge_core(trans, lhs_vid_new, lhs_vid_old, b1rhs_vid_old)?;
self.vertices
.merge_core(trans, rhs_vid_new, b1lhs_vid_old, rhs_vid_old)?;
self.attributes.merge_vertex_attributes_transac(
trans,
self.vertex_id(lhs_dart_id),
lhs_vid_new,
lhs_vid_old,
b1rhs_vid_old,
)?;
self.attributes.merge_vertex_attributes_transac(
trans,
self.vertex_id(rhs_dart_id),
rhs_vid_new,
b1lhs_vid_old,
rhs_vid_old,
)?;
self.attributes.merge_edge_attributes_transac(
trans,
self.edge_id(lhs_dart_id),
eid_new,
lhs_eid_old,
rhs_eid_old,
)?;
Expand Down