Modify

Opened 6 weeks ago

Closed 6 weeks ago

#3852 closed Bug (Fixed)

_ArrayToString -> speed optimization

Reported by: Zedna Owned by: Jpm
Milestone: 3.3.15.5 Component: Standard UDFs
Version: 3.3.15.4 Severity: None
Keywords: Cc:

Description

StringLen($sDelim_Col) is called for each row
but it should be called only once before For/Next loop.

original part of code:

			For $i = $iStart_Row To $iEnd_Row
				For $j = $iStart_Col To $iEnd_Col
					$sRet &= $aArray[$i][$j] & $sDelim_Col
				Next
				$sRet = StringTrimRight($sRet, StringLen($sDelim_Col)) & $sDelim_Row
			Next
			Return StringTrimRight($sRet, StringLen($sDelim_Row))

optimized part of code:

			$iDelimColLen = StringLen($sDelim_Col)
			For $i = $iStart_Row To $iEnd_Row
				For $j = $iStart_Col To $iEnd_Col
					$sRet &= $aArray[$i][$j] & $sDelim_Col
				Next
				$sRet = StringTrimRight($sRet, $iDelimColLen) & $sDelim_Row
			Next
			Return StringTrimRight($sRet, StringLen($sDelim_Row))

Attachments (0)

Change History (1)

comment:1 Changed 6 weeks ago by Jpm

  • Milestone set to 3.3.15.5
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [12597] in version: 3.3.15.5

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.