Skip to content

Commit ded3712

Browse files
committed
Remove inline helper
1 parent 084171d commit ded3712

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/main/php/io/streams/compress/SnappyOutputStream.class.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,6 @@ private function fragment() {
5454
$pos= $emit= 0;
5555
$out= '';
5656

57-
// Compare 4-byte offsets in data at offsets a and b
58-
$equals32= fn($a, $b) => (
59-
$this->buffer[$a] === $this->buffer[$b] &&
60-
$this->buffer[$a + 1] === $this->buffer[$b + 1] &&
61-
$this->buffer[$a + 2] === $this->buffer[$b + 2] &&
62-
$this->buffer[$a + 3] === $this->buffer[$b + 3]
63-
);
64-
6557
if ($end >= Snappy::INPUT_MARGIN) {
6658
$bits= 1;
6759
while ((1 << $bits) <= $end && $bits <= Snappy::HASH_BITS) {
@@ -88,7 +80,7 @@ private function fragment() {
8880
$next= ((unpack('V', $this->buffer, $forward)[1] * Snappy::HASH_KEY) & 0xffffffff) >> $shift;
8981
$candidate= $start + $hashtable[$hash];
9082
$hashtable[$hash]= ($pos - $start) & 0xffff;
91-
} while (!$equals32($pos, $candidate));
83+
} while (!$this->equals32($pos, $candidate));
9284

9385
$out.= $this->literal($pos - $emit).substr($this->buffer, $emit, $pos - $emit);
9486

@@ -119,7 +111,7 @@ private function fragment() {
119111
$hash= ((unpack('V', $this->buffer, $pos)[1] * Snappy::HASH_KEY) & 0xffffffff) >> $shift;
120112
$candidate= $start + $hashtable[$hash];
121113
$hashtable[$hash]= ($pos - $start) & 0xffff;
122-
} while ($equals32($pos, $candidate));
114+
} while ($this->equals32($pos, $candidate));
123115

124116
$pos++;
125117
$next= ((unpack('V', $this->buffer, $pos)[1] * Snappy::HASH_KEY) & 0xffffffff) >> $shift;

0 commit comments

Comments
 (0)