diff options
Diffstat (limited to 'includes/libs/lockmanager')
-rw-r--r-- | includes/libs/lockmanager/FSLockManager.php | 2 | ||||
-rw-r--r-- | includes/libs/lockmanager/PostgreSqlLockManager.php | 2 | ||||
-rw-r--r-- | includes/libs/lockmanager/QuorumLockManager.php | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/includes/libs/lockmanager/FSLockManager.php b/includes/libs/lockmanager/FSLockManager.php index f2624e721a78..019029c4807c 100644 --- a/includes/libs/lockmanager/FSLockManager.php +++ b/includes/libs/lockmanager/FSLockManager.php @@ -169,7 +169,7 @@ class FSLockManager extends LockManager { if ( $this->locksHeld[$path][$type] <= 0 ) { unset( $this->locksHeld[$path][$type] ); } - if ( !count( $this->locksHeld[$path] ) ) { + if ( $this->locksHeld[$path] === [] ) { unset( $this->locksHeld[$path] ); // no locks on this path if ( isset( $this->handles[$path] ) ) { $handlesToClose[] = $this->handles[$path]; diff --git a/includes/libs/lockmanager/PostgreSqlLockManager.php b/includes/libs/lockmanager/PostgreSqlLockManager.php index 65c69938a486..fd3ffa5cbcd6 100644 --- a/includes/libs/lockmanager/PostgreSqlLockManager.php +++ b/includes/libs/lockmanager/PostgreSqlLockManager.php @@ -18,7 +18,7 @@ class PostgreSqlLockManager extends DBLockManager { protected function doGetLocksOnServer( $lockSrv, array $paths, $type ) { $status = StatusValue::newGood(); - if ( !count( $paths ) ) { + if ( $paths === [] ) { return $status; // nothing to lock } diff --git a/includes/libs/lockmanager/QuorumLockManager.php b/includes/libs/lockmanager/QuorumLockManager.php index 1d2e21aa0d70..1ef4642a84a6 100644 --- a/includes/libs/lockmanager/QuorumLockManager.php +++ b/includes/libs/lockmanager/QuorumLockManager.php @@ -98,7 +98,7 @@ abstract class QuorumLockManager extends LockManager { $bucket = $this->getBucketFromPath( $path ); $pathsToUnlock[$bucket][$type][] = $path; } - if ( !count( $this->locksHeld[$path] ) ) { + if ( $this->locksHeld[$path] === [] ) { unset( $this->locksHeld[$path] ); // no SH or EX locks left for key } } @@ -110,7 +110,7 @@ abstract class QuorumLockManager extends LockManager { foreach ( $pathsToUnlock as $bucket => $pathsToUnlockByType ) { $status->merge( $this->doUnlockingRequestBucket( $bucket, $pathsToUnlockByType ) ); } - if ( !count( $this->locksHeld ) ) { + if ( $this->locksHeld === [] ) { $status->merge( $this->releaseAllLocks() ); $this->degradedBuckets = []; // safe to retry the normal quorum } |