Ignore:
Timestamp:
2012/06/21 15:02:41 (12 years ago)
Author:
pineray
Message:

#1859
foreach でキーしか使わない場合に array_keys で配列を作ってから渡す方法だと、
メモリを倍ほど消費することがわかったので、見苦しいけれど不要なバリューを生成する方向に.
F*in' PHP!

Location:
branches/version-2_12-dev/data/class/pages/frontparts/bloc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_News.php

    r21867 r21935  
    135135        // モバイルサイトのセッション保持 (#797) 
    136136        if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { 
    137             foreach (array_keys($arrNewsList) as $key) { 
     137            foreach ($arrNewsList as $key => $value) { 
    138138                $arrRow =& $arrNewsList[$key]; 
    139139                if (SC_Utils_Ex::isAppInnerUrl($arrRow['news_url'])) { 
  • branches/version-2_12-dev/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php

    r21867 r21935  
    111111            $arrProductList = $objProduct->getListByProductIds($objQuery, $arrProductId); 
    112112            // おすすめ商品情報にマージ 
    113             foreach (array_keys($arrBestProducts) as $key) { 
     113            foreach ($arrBestProducts as $key => $value) { 
    114114                $arrRow =& $arrBestProducts[$key]; 
    115115                if (isset($arrProductList[$arrRow['product_id']])) { 
Note: See TracChangeset for help on using the changeset viewer.