mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Cleanup code identified in code review
This commit is contained in:
@@ -104,7 +104,7 @@ HashRouter::shouldRelay (uint256 const& key)
|
||||
if (!s.shouldRelay(suppressionMap_.clock().now(), holdTime_))
|
||||
return boost::none;
|
||||
|
||||
return std::move(s.peekPeers());
|
||||
return s.releasePeerSet();
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
@@ -86,9 +86,10 @@ private:
|
||||
flags_ |= flagsToSet;
|
||||
}
|
||||
|
||||
std::set <PeerShortID>& peekPeers()
|
||||
/** Return set of peers we've relayed to and reset tracking */
|
||||
std::set<PeerShortID> releasePeerSet()
|
||||
{
|
||||
return peers_;
|
||||
return std::move(peers_);
|
||||
}
|
||||
|
||||
/** Determines if this item should be relayed.
|
||||
|
||||
@@ -192,13 +192,13 @@ SHAMap::walkTowardsKey(uint256 const& id, SharedPtrNodeStack* stack) const
|
||||
if (stack != nullptr)
|
||||
stack->push({inNode, nodeID});
|
||||
|
||||
auto const inner = std::static_pointer_cast<SHAMapInnerNode>(std::move(inNode));
|
||||
if (isv2)
|
||||
{
|
||||
auto n = std::static_pointer_cast<SHAMapInnerNodeV2>(inNode);
|
||||
if (!n->has_common_prefix(id))
|
||||
return nullptr;
|
||||
}
|
||||
auto const inner = std::static_pointer_cast<SHAMapInnerNode>(inNode);
|
||||
auto const branch = nodeID.selectBranch (id);
|
||||
if (inner->isEmptyBranch (branch))
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user