From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/ArrayUtils.php | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 includes/ArrayUtils.php (limited to 'includes/ArrayUtils.php') diff --git a/includes/ArrayUtils.php b/includes/ArrayUtils.php new file mode 100644 index 00000000..0b74f06a --- /dev/null +++ b/includes/ArrayUtils.php @@ -0,0 +1,69 @@ + $w ) { + $sum += $w; + # Do not return keys if they have 0 weight. + # Note that the "all 0 weight" case is handed above + if ( $w > 0 && $sum >= $rand ) { + break; + } + } + return $i; + } +} -- cgit v1.2.3-54-g00ecf