Skip to content

Commit e043cf3

Browse files
author
MarkBaker
committed
Eliminate loop in trimSheetFromCellReference() method
1 parent b4fc92e commit e043cf3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpSpreadsheet/Calculation/Functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ public static function trimTrailingRange(string $coordinate): string
705705

706706
public static function trimSheetFromCellReference(string $coordinate): string
707707
{
708-
while (strpos($coordinate, '!') !== false) {
709-
$coordinate = substr($coordinate, strpos($coordinate, '!') + 1);
708+
if (strpos($coordinate, '!') !== false) {
709+
$coordinate = substr($coordinate, strrpos($coordinate, '!') + 1);
710710
}
711711

712712
return $coordinate;

0 commit comments

Comments
 (0)