Make WordPress Core


Ignore:
Timestamp:
02/26/2015 05:47:53 AM (11 years ago)
Author:
wonderboymusic
Message:

Don't call the size function count() as part of a test condition in loops. Compute the size beforehand, and not on each iteration.

Scrutinizer added a Performance label: these are the only violations.

See #30799.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image-edit.php

    r31529 r31554  
    462462    if ( count($changes) > 1 ) {
    463463        $filtered = array($changes[0]);
    464         for ( $i = 0, $j = 1; $j < count($changes); $j++ ) {
     464        for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) {
    465465            $combined = false;
    466466            if ( $filtered[$i]->type == $changes[$j]->type ) {
Note: See TracChangeset for help on using the changeset viewer.