|
@@ 105-109 (lines=5) @@
|
| 102 |
|
while ($ipn > $this->m_idx_arr[$min] && $min++ < $max){}; |
| 103 |
|
} |
| 104 |
|
else { |
| 105 |
|
while($max - $min > 8){ |
| 106 |
|
$offset = ($min + $max) >> 1; |
| 107 |
|
if ($ipn > substr($this->m_idx_str, $offset*4, 4)) $min = $offset; |
| 108 |
|
else $max = $offset; |
| 109 |
|
} |
| 110 |
|
while ($ipn > substr($this->m_idx_str, $min*4, 4) && $min++ < $max){}; |
| 111 |
|
} |
| 112 |
|
return $min; |
|
@@ 118-122 (lines=5) @@
|
| 115 |
|
protected function search_db($str, $ipn, $min, $max){ |
| 116 |
|
if($max - $min > 1) { |
| 117 |
|
$ipn = substr($ipn, 1); |
| 118 |
|
while($max - $min > 8){ |
| 119 |
|
$offset = ($min + $max) >> 1; |
| 120 |
|
if ($ipn > substr($str, $offset * $this->block_len, 3)) $min = $offset; |
| 121 |
|
else $max = $offset; |
| 122 |
|
} |
| 123 |
|
while ($ipn >= substr($str, $min * $this->block_len, 3) && ++$min < $max){}; |
| 124 |
|
} |
| 125 |
|
else { |