diff options
| author | 2018-08-23 19:56:48 +0200 | |
|---|---|---|
| committer | 2018-08-23 19:56:48 +0200 | |
| commit | 7072c091a71e176a0cd57b91d570b26c8534870e (patch) | |
| tree | 3b6fe9199f5eb5dd7a2c45d95de42cb27fcb2fce | |
| parent | 69928aa7943b0be3f3bcf63afd66787486557c56 (diff) | |
better rand() (#1978)
http://php.net/manual/en/function.mt-rand.php
from php Doc
"Many random number generators of older libcs have dubious or unknown characteristics and are slow. The mt_rand() function is a drop-in replacement for the older rand(). It uses a random number generator with known characteristics using the ยป Mersenne Twister, which will produce random numbers four times faster than what the average libc rand() provides. "
| -rwxr-xr-x | app/Controllers/feedController.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 168d5a661..2f7495884 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -413,7 +413,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $entryDAO->updateLastSeen($feed->id(), $oldGuids, $mtime); } - if ($feed_history >= 0 && rand(0, 30) === 1) { + if ($feed_history >= 0 && mt_rand(0, 30) === 1) { // TODO: move this function in web cron when available (see entry::purge) // Remove old entries once in 30. if (!$entryDAO->inTransaction()) { |
