From e4d29824a65472298de40c9ab6c82ceb945e471e Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sun, 24 May 2015 12:32:24 +0100 Subject: [PATCH] General: (umpirsky) Work Item GH-548 - Optimize vlookup() sort --- Classes/PHPExcel/Calculation/LookupRef.php | 4 ++-- changelog.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index af38ea3..d860551 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -674,10 +674,10 @@ class PHPExcel_Calculation_LookupRef { reset($a); $firstColumn = key($a); - if (strtolower($a[$firstColumn]) == strtolower($b[$firstColumn])) { + if (($aLower = strtolower($a[$firstColumn])) == ($bLower = strtolower($b[$firstColumn]))) { return 0; } - return (strtolower($a[$firstColumn]) < strtolower($b[$firstColumn])) ? -1 : 1; + return ($aLower < $bLower) ? -1 : 1; } diff --git a/changelog.txt b/changelog.txt index d4afc0c..2f455c2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -26,6 +26,7 @@ Planned for 1.8.2 - Bugfix: (MBaker) - Fix to getCell() method when cell reference includes a worksheet reference - Bugfix: (ncrypthic) Work Item GH-570 - Ignore inlineStr type if formula element exists +- General: (umpirsky) Work Item GH-548 - Optimize vlookup() sort 2015-04-30 (v1.8.1):