Skip to content

Commit 9be2e28

Browse files
authored
Update Reader.php
1 parent d729eef commit 9be2e28

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/ipip/db/Reader.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ public function findMap($ip, $language)
135135
}
136136

137137
private $v4offset = 0;
138-
private $v6offsetCache = [];
139138

140139
/**
141140
* @param $ip
@@ -176,14 +175,6 @@ private function findNode($ip)
176175
$node = $this->v4offset;
177176
}
178177
}
179-
else
180-
{
181-
if (isset($this->v6offsetCache[$key]))
182-
{
183-
$index = 16;
184-
$node = $this->v6offsetCache[$key];
185-
}
186-
}
187178

188179
for ($i = $index; $i < $bitCount; $i++)
189180
{
@@ -193,11 +184,6 @@ private function findNode($ip)
193184
}
194185

195186
$node = $this->readNode($node, 1 & ((0xFF & ord($binary[$i >> 3])) >> 7 - ($i % 8)));
196-
197-
if ($i == 15)
198-
{
199-
$this->v6offsetCache[$key] = $node;
200-
}
201187
}
202188

203189
if ($node === $this->nodeCount)
@@ -300,4 +286,4 @@ public function getBuildTime()
300286
{
301287
return $this->meta['build'];
302288
}
303-
}
289+
}

0 commit comments

Comments
 (0)