Make WordPress Core

Changeset 31678


Ignore:
Timestamp:
03/08/2015 11:00:21 PM (10 years ago)
Author:
wonderboymusic
Message:

Avoid function calls on each iteration of a for loop.

See #30799.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r31554 r31678  
    17601760function antispambot( $email_address, $hex_encoding = 0 ) {
    17611761    $email_no_spam_address = '';
    1762     for ( $i = 0; $i < strlen( $email_address ); $i++ ) {
     1762    for ( $i = 0, $len = strlen( $email_address ); $i < $len; $i++ ) {
    17631763        $j = rand( 0, 1 + $hex_encoding );
    17641764        if ( $j == 0 ) {
  • trunk/src/wp-includes/plugin.php

    r31090 r31678  
    480480    else
    481481        $args[] = $arg;
    482     for ( $a = 2; $a < func_num_args(); $a++ )
     482    for ( $a = 2, $num = func_num_args(); $a < $num; $a++ )
    483483        $args[] = func_get_arg($a);
    484484
Note: See TracChangeset for help on using the changeset viewer.