Skip to content

Commit 7e234b5

Browse files
committed
Util: Increase test coverage
Change-Id: I80d3dc844768f2974e5521d4293bdf53c90360f8
1 parent 29d86e8 commit 7e234b5

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Util.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,13 @@ public static function hash( $s ) {
7575
// Do a 32-bit sum
7676
// Inlined here for speed
7777
$sum = ( $h & 0x3fffffff ) + ( $h5 & 0x3fffffff );
78-
$h =
79-
(
80-
( $sum & 0x40000000 ? 1 : 0 )
81-
+ ( $h & 0x80000000 ? 2 : 0 )
82-
+ ( $h & 0x40000000 ? 1 : 0 )
83-
+ ( $h5 & 0x80000000 ? 2 : 0 )
84-
+ ( $h5 & 0x40000000 ? 1 : 0 )
85-
) << 30
86-
| ( $sum & 0x3fffffff );
78+
$h = (
79+
( $sum & 0x40000000 ? 1 : 0 )
80+
+ ( $h & 0x80000000 ? 2 : 0 )
81+
+ ( $h & 0x40000000 ? 1 : 0 )
82+
+ ( $h5 & 0x80000000 ? 2 : 0 )
83+
+ ( $h5 & 0x40000000 ? 1 : 0 )
84+
) << 30 | ( $sum & 0x3fffffff );
8785
$h ^= ord( $s[$i] );
8886
$h &= 0xffffffff;
8987
}

0 commit comments

Comments
 (0)