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-includes/deprecated.php

    r31212 r31554  
    17571757    preg_match_all( '/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches );
    17581758    $links_summary = "\n";
    1759     for ( $i=0; $i<count($matches[0]); $i++ ) {
     1759    for ( $i = 0, $c = count( $matches[0] ); $i < $c; $i++ ) {
    17601760        $link_match = $matches[0][$i];
    17611761        $link_number = '['.($i+1).']';
Note: See TracChangeset for help on using the changeset viewer.