mirror of
https://github.com/chinayin/ip2region-core-php.git
synced 2025-12-03 20:29:33 +08:00
fix search() elseif
This commit is contained in:
parent
7612e59449
commit
9ab6658e7d
@ -122,20 +122,18 @@ class XdbSearcher
|
|||||||
if ($this->vectorIndex != null) {
|
if ($this->vectorIndex != null) {
|
||||||
$sPtr = self::getLong($this->vectorIndex, $idx);
|
$sPtr = self::getLong($this->vectorIndex, $idx);
|
||||||
$ePtr = self::getLong($this->vectorIndex, $idx + 4);
|
$ePtr = self::getLong($this->vectorIndex, $idx + 4);
|
||||||
|
} elseif ($this->contentBuff != null) {
|
||||||
|
$sPtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx);
|
||||||
|
$ePtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx + 4);
|
||||||
} else {
|
} else {
|
||||||
if ($this->contentBuff != null) {
|
// read the vector index block
|
||||||
$sPtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx);
|
$buff = $this->read(self::HeaderInfoLength + $idx, 8);
|
||||||
$ePtr = self::getLong($this->contentBuff, self::HeaderInfoLength + $idx + 4);
|
if ($buff === null) {
|
||||||
} else {
|
throw new \Exception("failed to read vector index at ${idx}");
|
||||||
// read the vector index block
|
|
||||||
$buff = $this->read(self::HeaderInfoLength + $idx, 8);
|
|
||||||
if ($buff === null) {
|
|
||||||
throw new \Exception("failed to read vector index at ${idx}");
|
|
||||||
}
|
|
||||||
|
|
||||||
$sPtr = self::getLong($buff, 0);
|
|
||||||
$ePtr = self::getLong($buff, 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sPtr = self::getLong($buff, 0);
|
||||||
|
$ePtr = self::getLong($buff, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// printf("sPtr: %d, ePtr: %d\n", $sPtr, $ePtr);
|
// printf("sPtr: %d, ePtr: %d\n", $sPtr, $ePtr);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user