MDL-75477 libraries: upgrade to version 1.11.0 of MaxMind.

This commit is contained in:
Paul Holden
2022-09-27 12:19:41 +01:00
parent 8f492a836a
commit 5b38e187d9
4 changed files with 14 additions and 13 deletions
+4 -11
View File
@@ -7,13 +7,6 @@ namespace MaxMind\Db\Reader;
// @codingStandardsIgnoreLine
use RuntimeException;
/*
* @ignore
*
* We subtract 1 from the log to protect against precision loss.
*/
\define(__NAMESPACE__ . '\_MM_MAX_INT_BYTES', (int) ((log(\PHP_INT_MAX, 2) - 1) / 8));
class Decoder
{
/**
@@ -316,11 +309,11 @@ class Decoder
$integer = 0;
// PHP integers are signed. _MM_MAX_INT_BYTES is the number of
// PHP integers are signed. PHP_INT_SIZE - 1 is the number of
// complete bytes that can be converted to an integer. However,
// we can convert another byte if the leading bit is zero.
$useRealInts = $byteLength <= _MM_MAX_INT_BYTES
|| ($byteLength === _MM_MAX_INT_BYTES + 1 && (\ord($bytes[0]) & 0x80) === 0);
$useRealInts = $byteLength <= \PHP_INT_SIZE - 1
|| ($byteLength === \PHP_INT_SIZE && (\ord($bytes[0]) & 0x80) === 0);
for ($i = 0; $i < $byteLength; ++$i) {
$part = \ord($bytes[$i]);
@@ -344,7 +337,7 @@ class Decoder
private function sizeFromCtrlByte(int $ctrlByte, int $offset): array
{
$size = $ctrlByte & 0x1f;
$size = $ctrlByte & 0x1F;
if ($size < 29) {
return [$size, $offset];