diff --git a/data/LanguageNameIndexer.php b/data/LanguageNameIndexer.php index c66b241b..49d585f8 100644 --- a/data/LanguageNameIndexer.php +++ b/data/LanguageNameIndexer.php @@ -120,12 +120,12 @@ class LanguageNameIndexer extends Maintenance { // - shortest matches appear first, especially exact matches // Sort buckets by index ksort( $buckets ); - foreach ( $buckets as $index => &$bucketTypes ) { + foreach ( $buckets as &$bucketTypes ) { $lengths[] = array_sum( array_map( 'count', $bucketTypes ) ); // Ensure 'prefix' is before 'infix'; krsort( $bucketTypes ); // Ensure each bucket has entries sorted - foreach ( $bucketTypes as $type => &$bucket ) { + foreach ( $bucketTypes as &$bucket ) { ksort( $bucket ); } } @@ -157,11 +157,11 @@ class LanguageNameIndexer extends Maintenance { } private function generateFile( array $buckets ) { - $template = <<s $data = preg_replace( '/(=>)\s+(\[)/m', '\1 \2', $data );