From 27edd5708d2f41a7f1239c7faa8ce2d3b3da97a4 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Wed, 20 Nov 2013 20:22:26 +0100 Subject: [PATCH] Avoid function calls in a for loop test part Change-Id: Ief0976e3d1cd1da7074b1ed6d427153ccc189f18 --- includes/diff/DairikiDiff.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php index bb0cb5fc98..37f1e59bff 100644 --- a/includes/diff/DairikiDiff.php +++ b/includes/diff/DairikiDiff.php @@ -843,7 +843,8 @@ class MappedDiff extends Diff { parent::__construct( $mapped_from_lines, $mapped_to_lines ); $xi = $yi = 0; - for ( $i = 0; $i < count( $this->edits ); $i++ ) { + $editCount = count( $this->edits ); + for ( $i = 0; $i < $editCount; $i++ ) { $orig = &$this->edits[$i]->orig; if ( is_array( $orig ) ) { $orig = array_slice( $from_lines, $xi, count( $orig ) ); -- 2.20.1