aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar ColonelMoutarde <4697568+ColonelMoutarde@users.noreply.github.com> 2018-08-23 19:56:48 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-08-23 19:56:48 +0200
commit7072c091a71e176a0cd57b91d570b26c8534870e (patch)
tree3b6fe9199f5eb5dd7a2c45d95de42cb27fcb2fce /app/Controllers
parent69928aa7943b0be3f3bcf63afd66787486557c56 (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. "
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/feedController.php2
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()) {