Merge "Add some casts for sanity before BagOStuff::add() calls"

This commit is contained in:
jenkins-bot 2014-06-27 18:34:09 +00:00 committed by Gerrit Code Review
commit af0f12c254
2 changed files with 2 additions and 2 deletions

View file

@ -338,7 +338,7 @@ abstract class BagOStuff {
*/
public function incrWithInit( $key, $ttl, $value = 1, $init = 1 ) {
return $this->incr( $key, $value ) ||
$this->add( $key, $init, $ttl ) || $this->incr( $key, $value );
$this->add( $key, (int)$init, $ttl ) || $this->incr( $key, $value );
}
/**

View file

@ -285,7 +285,7 @@ class UIDGenerator {
if ( $cache ) {
$counter = $cache->incr( $bucket, $count );
if ( $counter === false ) {
if ( !$cache->add( $bucket, $count ) ) {
if ( !$cache->add( $bucket, (int)$count ) ) {
throw new MWException( 'Unable to set value to ' . get_class( $cache ) );
}
$counter = $count;