From: Sarah Hoffmann Date: Thu, 13 May 2021 15:00:29 +0000 (+0200) Subject: Merge pull request #2325 from lonvia/do-not-precompute-postcodes X-Git-Tag: v4.0.0~85 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/96e6bbe3a1f2e2d41064e4ca19c0e22de42896c1?hp=fc860787ddaa8cf8dd93512f1219d748864856c9 Merge pull request #2325 from lonvia/do-not-precompute-postcodes Do not preload postcodes in the legacy tokenizer --- diff --git a/lib-php/lib.php b/lib-php/lib.php index a1f528fa..8d82c5b3 100644 --- a/lib-php/lib.php +++ b/lib-php/lib.php @@ -227,3 +227,10 @@ function closestHouseNumber($aRow) return max(min($aRow['endnumber'], $iHn), $aRow['startnumber']); } + +if (!function_exists('array_key_last')) { + function array_key_last(array $array) + { + if (!empty($array)) return key(array_slice($array, -1, 1, true)); + } +}