Skip to content

Commit

Permalink
Fixed - Reverted snappy compressor if statements order
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech committed Nov 7, 2023
1 parent c7e03c4 commit eb7cc8c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lib/snappy/src/Flow/Snappy/SnappyCompressor.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ private function hashFunc(int $key, int $hashFuncShift) : int

private function load32(array $array, int $pos) : int
{
if (!isset($array[$pos + 3])) {
return $array[$pos] + ($array[$pos + 1] << 8) + ($array[$pos + 2] << 16);
}

if (!isset($array[$pos + 2])) {
return $array[$pos] + ($array[$pos + 1] << 8);
if (!isset($array[$pos])) {
return 0;
}

if (!isset($array[$pos + 1])) {
return $array[$pos];
}

if (!isset($array[$pos])) {
return 0;
if (!isset($array[$pos + 2])) {
return $array[$pos] + ($array[$pos + 1] << 8);
}

if (!isset($array[$pos + 3])) {
return $array[$pos] + ($array[$pos + 1] << 8) + ($array[$pos + 2] << 16);
}

return $array[$pos] + ($array[$pos + 1] << 8) + ($array[$pos + 2] << 16) + ($array[$pos + 3] << 24);
Expand Down

0 comments on commit eb7cc8c

Please sign in to comment.