mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@31554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -461,7 +461,7 @@ function image_edit_apply_changes( $image, $changes ) {
|
||||
// Combine operations.
|
||||
if ( count($changes) > 1 ) {
|
||||
$filtered = array($changes[0]);
|
||||
for ( $i = 0, $j = 1; $j < count($changes); $j++ ) {
|
||||
for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) {
|
||||
$combined = false;
|
||||
if ( $filtered[$i]->type == $changes[$j]->type ) {
|
||||
switch ( $filtered[$i]->type ) {
|
||||
|
||||
Reference in New Issue
Block a user