public static function hash( $s ) {
$h = 5381;
for ( $i = 0; $i < strlen( $s ); $i++ ) {
- $h5 = ($h << 5) & 0xffffffff;
+ $h5 = ( $h << 5 ) & 0xffffffff;
// Do a 32-bit sum
// Inlined here for speed
- $sum = ($h & 0x3fffffff) + ($h5 & 0x3fffffff);
+ $sum = ( $h & 0x3fffffff ) + ( $h5 & 0x3fffffff );
$h =
(
( $sum & 0x40000000 ? 1 : 0 )
}
function close() {
- if( isset( $this->handle ) ) {
+ if ( isset( $this->handle ) ) {
fclose( $this->handle );
}
unset( $this->handle );
*/
public function close() {
$this->finish();
- if( isset( $this->handle ) ) {
+ if ( isset( $this->handle ) ) {
fclose( $this->handle );
}
if ( wfIsWindows() && file_exists( $this->realFileName ) ) {
$hp = $packedTables[$starts[$i] + $u];
$where = CdbFunctions::unsignedMod(
CdbFunctions::unsignedShiftRight( $hp['h'], 8 ), $len );
- while ( $hashtable[$where]['p'] )
- if ( ++$where == $len )
+ while ( $hashtable[$where]['p'] ) {
+ if ( ++$where == $len ) {
$where = 0;
+ }
+ }
$hashtable[$where] = $hp;
}