WordPress.org

Make WordPress Core

Changeset 38297


Ignore:
Timestamp:
08/21/2016 06:24:18 AM (3 years ago)
Author:
wonderboymusic
Message:

Comments: in WP_Comment_Query::fill_descendants(), compute count() in the first for expression so that it does not run on each iteration.

Props vishalkakadiya, deremohan.
Fixes #37416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-comment-query.php

    r38275 r38297  
    10131013        // Prime comment caches for non-top-level comments.
    10141014        $descendant_ids = array();
    1015         for ( $i = 1; $i < count( $levels ); $i++ ) {
     1015        for ( $i = 1, $c = count( $levels ); $i <= $c; $i++ ) {
    10161016            $descendant_ids = array_merge( $descendant_ids, $levels[ $i ] );
    10171017        }
Note: See TracChangeset for help on using the changeset viewer.