@@ -54,14 +54,6 @@ private function fragment() {
54
54
$ pos = $ emit = 0 ;
55
55
$ out = '' ;
56
56
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
-
65
57
if ($ end >= Snappy::INPUT_MARGIN ) {
66
58
$ bits = 1 ;
67
59
while ((1 << $ bits ) <= $ end && $ bits <= Snappy::HASH_BITS ) {
@@ -88,7 +80,7 @@ private function fragment() {
88
80
$ next = ((unpack ('V ' , $ this ->buffer , $ forward )[1 ] * Snappy::HASH_KEY ) & 0xffffffff ) >> $ shift ;
89
81
$ candidate = $ start + $ hashtable [$ hash ];
90
82
$ hashtable [$ hash ]= ($ pos - $ start ) & 0xffff ;
91
- } while (!$ equals32 ($ pos , $ candidate ));
83
+ } while (!$ this -> equals32 ($ pos , $ candidate ));
92
84
93
85
$ out .= $ this ->literal ($ pos - $ emit ).substr ($ this ->buffer , $ emit , $ pos - $ emit );
94
86
@@ -119,7 +111,7 @@ private function fragment() {
119
111
$ hash = ((unpack ('V ' , $ this ->buffer , $ pos )[1 ] * Snappy::HASH_KEY ) & 0xffffffff ) >> $ shift ;
120
112
$ candidate = $ start + $ hashtable [$ hash ];
121
113
$ hashtable [$ hash ]= ($ pos - $ start ) & 0xffff ;
122
- } while ($ equals32 ($ pos , $ candidate ));
114
+ } while ($ this -> equals32 ($ pos , $ candidate ));
123
115
124
116
$ pos ++;
125
117
$ next = ((unpack ('V ' , $ this ->buffer , $ pos )[1 ] * Snappy::HASH_KEY ) & 0xffffffff ) >> $ shift ;
0 commit comments