From 45330afebd1b4922627c74f3c9a5b0cc1e9a3120 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 21 Dec 2015 11:15:11 -0800 Subject: [PATCH] Remove arbitrary newSequentialPerNodeIDs() $count limit The increment is done in one step, so there is no real reason to limit this (e.g. performance). It simply makes errors that can break things. Bug: T122068 Change-Id: I3278b4ddfe862f8043b6788b3e82e90be730f68c --- includes/utils/UIDGenerator.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/utils/UIDGenerator.php b/includes/utils/UIDGenerator.php index e2de900a16..74aded6975 100644 --- a/includes/utils/UIDGenerator.php +++ b/includes/utils/UIDGenerator.php @@ -334,7 +334,7 @@ class UIDGenerator { * @see UIDGenerator::newSequentialPerNodeID() * @param string $bucket Arbitrary bucket name (should be ASCII) * @param int $bits Bit size (16 to 48) of resulting numbers before wrap-around - * @param int $count Number of IDs to return (1 to 10000) + * @param int $count Number of IDs to return * @param int $flags (supports UIDGenerator::QUICK_VOLATILE) * @return array Ordered list of float integer values * @since 1.23 @@ -350,7 +350,7 @@ class UIDGenerator { * @see UIDGenerator::newSequentialPerNodeID() * @param string $bucket Arbitrary bucket name (should be ASCII) * @param int $bits Bit size (16 to 48) of resulting numbers before wrap-around - * @param int $count Number of IDs to return (1 to 10000) + * @param int $count Number of IDs to return * @param int $flags (supports UIDGenerator::QUICK_VOLATILE) * @return array Ordered list of float integer values * @throws RuntimeException @@ -358,8 +358,6 @@ class UIDGenerator { protected function getSequentialPerNodeIDs( $bucket, $bits, $count, $flags ) { if ( $count <= 0 ) { return array(); // nothing to do - } elseif ( $count > 10000 ) { - throw new RuntimeException( "Number of requested IDs ($count) is too high." ); } elseif ( $bits < 16 || $bits > 48 ) { throw new RuntimeException( "Requested bit size ($bits) is out of range." ); } -- 2.20.1