Fix routing_table bucket_size(int bucket) out_of_range logic error.

This commit is contained in:
Thomas Yuan 2015-09-10 17:16:11 -04:00
parent 8b6b8240c1
commit bee620b4f1
1 changed files with 1 additions and 1 deletions

View File

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