mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-03-22 00:59:08 +01:00
narrow down random range
This commit is contained in:
parent
367df4d0db
commit
64ec7dd559
1 changed files with 5 additions and 3 deletions
|
@ -1238,13 +1238,15 @@ namespace data
|
||||||
{
|
{
|
||||||
// before
|
// before
|
||||||
inds[1] %= inds[0];
|
inds[1] %= inds[0];
|
||||||
std::advance (it1, inds[1]);
|
std::advance (it1, (inds[1] + inds[0])/2);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
it1 = it;
|
||||||
auto it2 = it;
|
auto it2 = it;
|
||||||
if (inds[0] < m_RouterInfos.size () - 1)
|
if (inds[0] < m_RouterInfos.size () - 1)
|
||||||
{
|
{
|
||||||
// after
|
// after
|
||||||
inds[2] %= (m_RouterInfos.size () - 1 - inds[0]);
|
inds[2] %= (m_RouterInfos.size () - 1 - inds[0]); inds[2] /= 2;
|
||||||
std::advance (it2, inds[2]);
|
std::advance (it2, inds[2]);
|
||||||
}
|
}
|
||||||
// it1 - from, it2 - to
|
// it1 - from, it2 - to
|
||||||
|
|
Loading…
Add table
Reference in a new issue