Skip to content

Commit

Permalink
Fixed snappy warnings (#760)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Nov 7, 2023
1 parent f9aac0a commit 34d6be4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lib/snappy/src/Flow/Snappy/SnappyCompressor.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@ 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 + 1])) {
return $array[$pos];
}

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

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

Expand Down

0 comments on commit 34d6be4

Please sign in to comment.