Modify

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#1184 closed Bug/Fehler (fixed)

for-Schleife optimieren in /includes/functions/sessions.php

Reported by: noRiddle Owned by: somebody
Priority: normal Milestone: modified-shop-2.0.3.0
Component: Shop Version: 2.0.2.2
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by Torsten Riemer)

Siehe dazu bitte diesen Thread im Experten Forum: 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

Attachments (0)

Change History (5)

comment:1 by Torsten Riemer, 9 years ago

Component: AdminShop
Description: modified (diff)
Milestone: modified-shop-2.0.2.3
Version: 2.0.2.2

comment:2 by Torsten Riemer, 9 years ago

Milestone: modified-shop-2.0.2.3modified-shop-2.0.2.4

comment:3 by Gerhard Waldemair, 9 years ago

Resolution: fixed
Status: newclosed

In 10779:

fix #1184

comment:4 by Torsten Riemer, 9 years ago

Milestone: modified-shop-2.0.2.4modified-shop-2.0.2.3

comment:5 by Torsten Riemer, 8 years ago

Reporter: changed from anonymous to noRiddle

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.