QRandomGenerator: remove dead code previously used by qrand()
Commit9ee554ac1d
removed qrand() and qsrand(), so commit81896304dc
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:
parent
4f4d7de499
commit
420755edb7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user