Bug #22194

Performance optimization: change while(list() to foreach()

Added by Georg Ringer over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-02-26
Due date:
% Done:

0%

TYPO3 Version:
4.3
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

foreach($arr as $key=>$value) is faster than while (list($key, $value)=each($arr)) so it should be changed

(issue imported from #M13670)

13670-whilelist-foreach.patch View (18.3 KB) Administrator Admin, 2010-02-26 00:40

13670-whilelist-foreach_v2.patch View (25.1 KB) Administrator Admin, 2010-02-26 07:33

13670-whilelist-foreach_v2-adodb.patch View (1.43 KB) Administrator Admin, 2010-02-27 11:59

13670-whilelist-foreach_v2-dbal.patch View (1.7 KB) Administrator Admin, 2010-02-27 11:59

13670-whilelist-foreach_v2-extbase.patch View (1.73 KB) Administrator Admin, 2010-02-27 11:59

13670-whilelist-foreach_v3-general.patch View (182 KB) Administrator Admin, 2010-02-27 11:59

13670-whilelist-foreach_v4-general.patch View (186 KB) Administrator Admin, 2010-02-27 15:19

13670_v5-general.diff View (166 KB) Administrator Admin, 2010-05-13 16:42


Related issues

Related to TYPO3 Core - Bug #22656: Fatal Error introduced in impexp with #22194 (Performance optimization: change while(list() to foreach()) Closed 2010-05-15
Related to TYPO3 Core - Bug #22724: prioriCalc no longer working correctly after #0013670 (Performance optimization: change while(list() to foreach()) Closed 2010-05-27
Related to TYPO3 Core - Bug #22953: Export module does not keep pagetree configuration Closed 2010-06-21
Duplicated by TYPO3 Core - Feature #22207: class.t3lib_tsparser_ext uses while (list) each instead of better foreach Closed 2010-02-28

History

#1 Updated by Georg Ringer over 10 years ago

v4 fixes some flaws

#2 Updated by Benni Mack over 10 years ago

Georg, great patch. Could you please update it so it works with the current trunk again?

Thanks.

#3 Updated by Steffen Gebert over 10 years ago

Updated patch attached and in core list

#4 Updated by Ernesto Baschny over 10 years ago

Commited the latest (13670_v5-general.diff ) split up to trunk:

rev. 7592 = t3lib/
rev. 7593 = typo3/
rev. 7594 = typo3/mod/tools/em/
rev. 7595 = typo3/sysext/tstemplate_objbrowser/
rev. 7596 = typo3/sysext/belog/
rev. 7597 = typo3/sysext/lowlevel/
rev. 7598 = typo3/sysext/wizard_crpages/
rev. 7599 = typo3/sysext/statictemplates/
rev. 7600 = typo3/sysext/lang/
rev. 7601 = typo3/sysext/cms/
rev. 7602 = typo3/sysext/version/
rev. 7603 = typo3/sysext/wizard_sortpages/
rev. 7604 = typo3/sysext/impexp/
rev. 7605 = typo3/sysext/indexed_search/
rev. 7606 = typo3/sysext/rtehtmlarea/
rev. 7607 = typo3/sysext/extra_page_cm_options/
rev. 7608 = typo3/sysext/sys_action/

Also available in: Atom PDF