QRandomGenerator: remove dead code previously used by qrand()

Commit 9ee554ac1d removed qrand() and
qsrand(), so commit 81896304dc removed the
functions accessing QRandEngine, but forgot to remove the actual engine.

Pick-to: 6.1
Change-Id: I26b8286f61534f88b649fffd166c41aecf55d2b1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Thiago Macieira 2021-03-14 09:16:25 -07:00 committed by Volker Hilsheimer
parent 4f4d7de499
commit 420755edb7

View File

@ -1295,26 +1295,4 @@ quint64 QRandomGenerator::_fillRange(void *buffer, qptrdiff count)
return begin[0] | (quint64(begin[1]) << 32);
}
namespace {
struct QRandEngine
{
std::minstd_rand engine;
QRandEngine() : engine(1) {}
int generate()
{
std::minstd_rand::result_type v = engine();
if (std::numeric_limits<int>::max() != RAND_MAX)
v %= uint(RAND_MAX) + 1;
return int(v);
}
void seed(std::minstd_rand::result_type q)
{
engine.seed(q);
}
};
}
QT_END_NAMESPACE