From 420755edb71267f756df4c61955b910099ec9537 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 14 Mar 2021 09:16:25 -0700 Subject: [PATCH] QRandomGenerator: remove dead code previously used by qrand() Commit 9ee554ac1d1af97e7ad5b4bf78e2779f7d1c405f removed qrand() and qsrand(), so commit 81896304dc1fb65da3302deb54ab4cfe060625ff removed the functions accessing QRandEngine, but forgot to remove the actual engine. Pick-to: 6.1 Change-Id: I26b8286f61534f88b649fffd166c41aecf55d2b1 Reviewed-by: Volker Hilsheimer --- src/corelib/global/qrandom.cpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index eb7acc5edf..6db8121028 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -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::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