$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
}
}
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
}