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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/helper/SC_Helper_Purchase.php

    r21927 r21935  
    317317    function clearShipmentItemTemp($shipping_id = null) { 
    318318        if (is_null($shipping_id)) { 
    319             foreach (array_keys($_SESSION['shipping']) as $key) { 
     319            foreach ($_SESSION['shipping'] as $key => $value) { 
    320320                $this->clearShipmentItemTemp($key); 
    321321            } 
     
    10361036     */ 
    10371037    function setDownloadableFlgTo(&$arrOrderDetail) { 
    1038         foreach (array_keys($arrOrderDetail) as $key) { 
     1038        foreach ($arrOrderDetail as $key => $value) { 
    10391039            // 販売価格が 0 円 
    10401040            if ($arrOrderDetail[$key]['price'] == '0') { 
     
    10721072 
    10731073        if ($has_items) { 
    1074             foreach (array_keys($arrResults) as $shipping_id) { 
     1074            foreach ($arrResults as $shipping_id => $value) { 
    10751075                $arrResults[$shipping_id]['shipment_item'] 
    10761076                        =& $this->getShipmentItems($order_id, $shipping_id); 
Note: See TracChangeset for help on using the changeset viewer.