r81672 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81671‎ | r81672 | r81673 >
Date:00:58, 8 February 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Remove unused $bits = preg_split( $this->tags, $left_slices[$i] );

Remove unused $tt assignment
Modified paths:
  • /trunk/extensions/DoubleWiki/DoubleWiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php
@@ -105,7 +105,6 @@
106106 return true;
107107 }
108108
109 -
110109 /*
111110 * Format the text as a two-column table with aligned paragraphs
112111 */
@@ -190,8 +189,6 @@
191190 return $head . $body . "</table>" ;
192191 }
193192
194 -
195 -
196193 /*
197194 * Split text and return a set of html-balanced paragraphs
198195 */
@@ -221,7 +218,6 @@
222219 return $result;
223220 }
224221
225 -
226222 /*
227223 * Split text and return a set of html-balanced slices
228224 */
@@ -253,7 +249,6 @@
254250 */
255251 $stack = array();
256252 for( $i=0 ; $i < $n ; $i++) {
257 - $bits = preg_split( $this->tags, $left_slices[$i] );
258253 $m = array();
259254 preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER);
260255 $counter = 0;
@@ -263,7 +258,7 @@
264259 $counter++;
265260 array_push($stack, $t);
266261 } else {
267 - $tt = array_pop($stack);
 262+ array_pop($stack);
268263 $counter--;
269264 }
270265 }
@@ -278,7 +273,7 @@
279274 } else if( $i == $n - 1 ) {
280275 $left_slices[$i] = $opening . $left_slices[$i];
281276 } else if( $counter != 0 ) {
282 - $left_slices[$i+1] = $left_slices[$i] . $left_slices[$i+1];
 277+ $left_slices[$i + 1] = $left_slices[$i] . $left_slices[$i+1];
283278 $left_slices[$i] = '';
284279 }
285280 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r81993MFT r81672demon20:56, 11 February 2011
r81994MFT r81672demon20:56, 11 February 2011

Comments

#Comment by 😂 (talk | contribs)   20:59, 11 February 2011

Went ahead and merged them. I'm pretty sure removing the (completely unused) preg_split() in a for loop will help the constant OOM errors we're seeing on the cluster.

Status & tagging log