Browse Source

cosmetic fix

pull/628/head
Jeff Becker 8 years ago
parent
commit
3ea624e1db
No known key found for this signature in database
GPG Key ID: AB950234D6EA286B
  1. 4
      NetDb.cpp

4
NetDb.cpp

@ -350,7 +350,7 @@ namespace data
std::vector<std::shared_ptr<const RouterInfo> > found; std::vector<std::shared_ptr<const RouterInfo> > found;
const size_t max_iters_per_cyle = 3; const size_t max_iters_per_cyle = 3;
size_t iters = max_iters_per_cyle; size_t iters = max_iters_per_cyle;
while(n) while(n > 0)
{ {
std::unique_lock<std::mutex> lock(m_RouterInfosMutex); std::unique_lock<std::mutex> lock(m_RouterInfosMutex);
uint32_t idx = rand () % m_RouterInfos.size (); uint32_t idx = rand () % m_RouterInfos.size ();
@ -372,6 +372,8 @@ namespace data
else // not there yet else // not there yet
++i; ++i;
} }
// we have enough
if(n == 0) break;
--iters; --iters;
// have we tried enough this cycle ? // have we tried enough this cycle ?
if(!iters) { if(!iters) {

Loading…
Cancel
Save