r82197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82196‎ | r82197 | r82198 >
Date:21:55, 15 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Fixup another count being done in a loop
Modified paths:
  • /trunk/extensions/DoubleWiki/DoubleWiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php
@@ -135,7 +135,7 @@
136136 $left_chunk .= $left_slices[$i];
137137
138138 # if we are at the end of the loop, finish quickly
139 - if ( $i == count( $left_slices ) - 1 ) {
 139+ if ( $i == $leftSliceCount - 1 ) {
140140 $right_chunk .= $right_text;
141141 $found = true;
142142 } else {
@@ -164,8 +164,8 @@
165165 // $body .= "<tr style=\"background-color:#ffdddd;\"><td>".count($left_bits)."</td><td>".count($right_bits)."</td></tr>\n";
166166 // Do not align paragraphs if counts are different
167167 if ( count( $left_bits ) != count( $right_bits ) ) {
168 - $left_bits = Array( $left_chunk );
169 - $right_bits = Array( $right_chunk );
 168+ $left_bits = array( $left_chunk );
 169+ $right_bits = array( $right_chunk );
170170 }
171171
172172 $left_chunk = '';

Status & tagging log