forked from premiere/premiere-libtorrent
Merge pull request #153 from thomas-yuan/bug_fix
Fix routing_table bucket_size(int bucket) out_of_range logic error.
This commit is contained in:
commit
f847104252
|
@ -148,7 +148,7 @@ public:
|
|||
{
|
||||
int num_buckets = m_buckets.size();
|
||||
if (num_buckets == 0) return 0;
|
||||
if (bucket < num_buckets) bucket = num_buckets - 1;
|
||||
if (bucket >= num_buckets) bucket = num_buckets - 1;
|
||||
table_t::const_iterator i = m_buckets.begin();
|
||||
std::advance(i, bucket);
|
||||
return int(i->live_nodes.size());
|
||||
|
|
Loading…
Reference in New Issue