﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking
1184	for-Schleife optimieren in /includes/functions/sessions.php	anonymous	somebody	"Siehe dazu bitte diesen Thread im Experten Forum: [https://www.modified-shop.org/forum/index.php?topic=37133.0 Session-Handling in 2.0.2.2]

Suche in ""/includes/functions/sessions.php"":
{{{
    if ($session_data != '') {
      $variables = array();
      $a = preg_split( ""/(\w+)\|/"", $session_data, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
      for( $i = 0; $i < count( $a ); $i = $i+2 ) {
        $variables[$a[$i]] = unserialize( $a[$i+1] );
      }
      return($variables);
    }
}}}
Hier wird bei jedem Loop in der for-Schleife ein ''count()'' gemacht.
So wäre es besser und viel schneller:
{{{
      for( $i = 0, $ca = count($a); $i < $ca; $i = $i+2 ) {
        $variables[$a[$i]] = unserialize( $a[$i+1] );
      }
}}}
Gruß,
noRiddle"	Bug/Fehler	new	normal	modified-shop-2.0.2.3	Shop	2.0.2.2					
