File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -547,17 +547,17 @@ std::vector<DSR::Node> DSRGraph::get_nodes_by_types(const std::vector<std::strin
547547// ////////////////////////////////////////////////////////////////////////////////
548548std::optional<CRDTEdge> DSRGraph::get_edge_ (uint64_t from, uint64_t to, const std::string &key)
549549{
550- // std::shared_lock<std::shared_mutex> lock(_mutex);
551- if (nodes.contains (from) && nodes.contains (to))
552- {
553- auto n = get_ (from);
554- if (n.has_value ()) {
555- auto edge = n.value ().fano ().find ({to, key});
556- if (edge != n.value ().fano ().end ()) {
557- return edge->second .read_reg ();
558- }
559- }
550+ auto from_it = nodes.find (from);
551+ if (from_it == nodes.end () || from_it->second .empty () || !nodes.contains (to)) {
552+ return {};
560553 }
554+
555+ auto & fano = from_it->second .read_reg ().fano ();
556+ auto edge = fano.find ({to, key});
557+ if (edge != fano.end () && !edge->second .empty ()) {
558+ return edge->second .read_reg ();
559+ }
560+
561561 return {};
562562}
563563
You can’t perform that action at this time.
0 commit comments