Cleanup code identified in code review

This commit is contained in:
Nik Bougalis
2016-11-15 22:22:09 -08:00
parent db95808206
commit 44167a6bcb
3 changed files with 5 additions and 4 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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;