Fixed issue #13670: Performance optimization: change while(list() to foreach() (thank...
authorErnesto Baschny <ernst@cron-it.de>
Thu, 13 May 2010 17:12:25 +0000 (17:12 +0000)
committerErnesto Baschny <ernst@cron-it.de>
Thu, 13 May 2010 17:12:25 +0000 (17:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7596 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/belog/class.tx_belog_webinfo.php
typo3/sysext/belog/mod/index.php

index 99a4d30..de41851 100755 (executable)
@@ -217,7 +217,7 @@ class tx_belog_webinfo extends t3lib_extobjbase {
                        }
 
                        if (is_array($this->pObj->be_user_Array))       {
-                               while(list(,$val)=each($this->pObj->be_user_Array))     {
+                               foreach ($this->pObj->be_user_Array as $val) {
                                        $selectUsers[]=$val['uid'];
                                }
                        }
index 9e0c0eb..aa4a00c 100755 (executable)
@@ -187,15 +187,15 @@ class SC_mod_tools_log_index {
 
                // Adding groups to the users_array
                $groups = t3lib_BEfunc::getGroupNames();
-                       if (is_array($groups))  {
-                       while(list(,$grVals)=each($groups))     {
+               if (is_array($groups))  {
+                       foreach ($groups as $grVals) {
                                $this->MOD_MENU['users']['gr-'.$grVals['uid']] = 'Group: '.$grVals['title'];
                        }
                }
 
                $users = t3lib_BEfunc::getUserNames();
                if (is_array($users))   {
-                       while(list(,$grVals)=each($users))      {
+                       foreach ($users as $grVals) {
                                $this->MOD_MENU['users']['us-'.$grVals['uid']] = 'User: '.$grVals['username'];
                        }
                }
@@ -341,7 +341,7 @@ class SC_mod_tools_log_index {
                if (substr($this->MOD_SETTINGS['users'],0,3) == "gr-")  {       // All users
                        $this->be_user_Array = t3lib_BEfunc::blindUserNames($this->be_user_Array,array(substr($this->MOD_SETTINGS['users'],3)),1);
                        if (is_array($this->be_user_Array))     {
-                               while(list(,$val)=each($this->be_user_Array))   {
+                               foreach ($this->be_user_Array as $val) {
                                        if ($val['uid']!=$BE_USER->user['uid']) {
                                                $selectUsers[]=$val['uid'];
                                        }