From 1e4934e9b7ccea0e5b497ec21387d77734469abd Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 10 Nov 2010 19:19:46 +0000 Subject: [PATCH] foreach loop is pointless if you're then just going to keep a counter manually Hence switch foreach to for loop --- includes/parser/Parser.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 4a8352463d..c1ac704c0e 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1260,10 +1260,9 @@ class Parser { # First, do some preliminary work. This may shift some apostrophes from # being mark-up to being text. It also counts the number of occurrences # of bold and italics mark-ups. - $i = 0; $numbold = 0; $numitalics = 0; - foreach ( $arr as $r ) { + for ( $i = 0; $i < count( $arr ); $i++ ) { if ( ( $i % 2 ) == 1 ) { # If there are ever four apostrophes, assume the first is supposed to # be text, and the remaining three constitute mark-up for bold text. @@ -1287,7 +1286,6 @@ class Parser { $numbold++; } } - $i++; } # If there is an odd number of both bold and italics, it is likely -- 2.20.1