mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-23 16:49:29 +00:00
Minor performance tweaks when working with alternating blocks in a string
git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@68309 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
@@ -348,9 +348,10 @@ class PHPExcel_ReferenceHelper
|
||||
public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, $sheetName = '') {
|
||||
// Update cell references in the formula
|
||||
$formulaBlocks = explode('"',$pFormula);
|
||||
foreach($formulaBlocks as $i => &$formulaBlock) {
|
||||
// Ignore blocks that were enclosed in quotes (even entries in the $formulaBlocks array after the explode)
|
||||
if (($i % 2) == 0) {
|
||||
$i = false;
|
||||
foreach($formulaBlocks as &$formulaBlock) {
|
||||
// Ignore blocks that were enclosed in quotes (alternating entries in the $formulaBlocks array after the explode)
|
||||
if ($i = !$i) {
|
||||
$adjustCount = 0;
|
||||
$newCellTokens = $cellTokens = array();
|
||||
// Search for row ranges (e.g. 'Sheet1'!3:5 or 3:5) with or without $ absolutes (e.g. $3:5)
|
||||
|
||||
Reference in New Issue
Block a user