Skip to content

Commit 518f3f0

Browse files
committed
fix: move get_edge_ call after lock in join_delta_edge
1 parent 56bfef6 commit 518f3f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/dsr_api.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,8 @@ void DSRGraph::join_delta_edge(IDL::MvregEdge &&mvreg)
11711171
std::optional<Edge> deleted_edge;
11721172
{
11731173
auto crdt_delta = IDLEdge_to_CRDT(std::move(mvreg));
1174-
deleted_edge = get_edge_(from, to, type);
11751174
std::unique_lock<std::shared_mutex> lock(_mutex);
1175+
deleted_edge = get_edge_(from, to, type);
11761176
//Check if the node where we are joining the edge exist.
11771177
bool cfrom{nodes.contains(from)}, cto{nodes.contains(to)};
11781178
bool dfrom{deleted.contains(from)}, dto{deleted.contains(to)};

0 commit comments

Comments
 (0)