Bug #22194

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

Added by Georg Ringer almost 12 years ago. Updated over 11 years ago.

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

0%

Estimated time:
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)


Files

13670-whilelist-foreach.patch (18.3 KB) 13670-whilelist-foreach.patch Administrator Admin, 2010-02-26 00:40
13670-whilelist-foreach_v2.patch (25.1 KB) 13670-whilelist-foreach_v2.patch Administrator Admin, 2010-02-26 07:33
13670-whilelist-foreach_v2-adodb.patch (1.43 KB) 13670-whilelist-foreach_v2-adodb.patch Administrator Admin, 2010-02-27 11:59
13670-whilelist-foreach_v2-dbal.patch (1.7 KB) 13670-whilelist-foreach_v2-dbal.patch Administrator Admin, 2010-02-27 11:59
13670-whilelist-foreach_v2-extbase.patch (1.73 KB) 13670-whilelist-foreach_v2-extbase.patch Administrator Admin, 2010-02-27 11:59
13670-whilelist-foreach_v3-general.patch (182 KB) 13670-whilelist-foreach_v3-general.patch Administrator Admin, 2010-02-27 11:59
13670-whilelist-foreach_v4-general.patch (186 KB) 13670-whilelist-foreach_v4-general.patch Administrator Admin, 2010-02-27 15:19
13670_v5-general.diff (166 KB) 13670_v5-general.diff Administrator Admin, 2010-05-13 16:42

Related issues

Related to TYPO3 Core - Bug #22724: prioriCalc no longer working correctly after #0013670 (Performance optimization: change while(list() to foreach())ClosedOliver Hader2010-05-27

Actions
Related to TYPO3 Core - Bug #22953: Export module does not keep pagetree configurationClosedChris topher2010-06-21

Actions
Has duplicate TYPO3 Core - Feature #22207: class.t3lib_tsparser_ext uses while (list) each instead of better foreachClosedFrancois Suter2010-02-28

Actions
#1

Updated by Georg Ringer almost 12 years ago

v4 fixes some flaws

#2

Updated by Benni Mack over 11 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 11 years ago

Updated patch attached and in core list

#4

Updated by Ernesto Baschny over 11 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