narrow down random range

This commit is contained in:
orignal 2021-08-03 19:26:09 -04:00
parent 367df4d0db
commit 64ec7dd559

View file

@ -1238,13 +1238,15 @@ namespace data
{
// before
inds[1] %= inds[0];
std::advance (it1, inds[1]);
std::advance (it1, (inds[1] + inds[0])/2);
}
else
it1 = it;
auto it2 = it;
if (inds[0] < m_RouterInfos.size () - 1)
{
// 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]);
}
// it1 - from, it2 - to