Reorder keys

This doesn't make any functional difference, but helps minimize later
patch Ida9612d14

Change-Id: Ice89bad02e077437d0df6fa9f51f90b4cab4837c
This commit is contained in:
Adam Wight 2019-11-26 17:06:01 +01:00
parent 38d7c09495
commit ec091fe906
2 changed files with 40 additions and 40 deletions

View file

@ -134,10 +134,10 @@ class ReferenceStack {
}
array_splice( $this->refs[$group], $k, 0, [ [
'count' => -1,
'text' => $text,
'key' => ++$this->refSequence,
'follow' => $follow,
'dir' => $dir,
'key' => ++$this->refSequence,
'text' => $text,
'follow' => $follow,
] ] );
array_splice( $this->refCallStack, $k, 0,
[ [ 'new', $argv, $text, $name, $group, $this->refSequence ] ] );
@ -150,9 +150,9 @@ class ReferenceStack {
// This is an anonymous reference, which will be given a numeric index.
$this->refs[$group][] = [
'count' => -1,
'text' => $text,
'dir' => $dir,
'key' => ++$this->refSequence,
'dir' => $dir
'text' => $text,
];
$this->refCallStack[] = [ 'new', $argv, $text, $name, $group, $this->refSequence ];
@ -161,11 +161,11 @@ class ReferenceStack {
// Valid key with first occurrence
if ( !isset( $this->refs[$group][$name] ) ) {
$this->refs[$group][$name] = [
'text' => $text,
'count' => -1,
'dir' => $dir,
'key' => ++$this->refSequence,
'text' => $text,
'number' => ++$this->groupRefSequence[$group],
'dir' => $dir
];
$action = 'new';
} elseif ( $this->refs[$group][$name]['text'] === null && $text !== '' ) {

View file

@ -69,9 +69,9 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
'' => [
[
'count' => -1,
'text' => null,
'key' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => null,
]
]
],
@ -90,9 +90,9 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
'foo' => [
[
'count' => -1,
'text' => null,
'key' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => null,
]
]
],
@ -111,9 +111,9 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
'foo' => [
[
'count' => -1,
'text' => 'text',
'key' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text',
]
]
],
@ -131,11 +131,11 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
[
'foo' => [
'name' => [
'text' => 'text',
'count' => 0,
'key' => 1,
'number' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text',
'number' => 1,
]
]
],
@ -155,11 +155,11 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
[
'foo' => [
'a' => [
'text' => 'text-a text-b',
'count' => 0,
'key' => 1,
'number' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text-a text-b',
'number' => 1,
]
]
],
@ -178,10 +178,10 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
'foo' => [
[
'count' => -1,
'text' => 'text',
'key' => 1,
'follow' => 'a',
'dir' => 'rtl',
'key' => 1,
'text' => 'text',
'follow' => 'a',
]
]
],
@ -204,24 +204,24 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
'foo' => [
0 => [
'count' => -1,
'text' => 'text-b',
'key' => 2,
'follow' => 'c',
'dir' => 'rtl',
'key' => 2,
'text' => 'text-b',
'follow' => 'c',
],
'a' => [
'text' => 'text-a',
'count' => 0,
'key' => 1,
'number' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text-a',
'number' => 1,
],
'c' => [
'text' => 'text-c',
'count' => 0,
'key' => 3,
'number' => 2,
'dir' => 'rtl',
'key' => 3,
'text' => 'text-c',
'number' => 2,
]
]
],
@ -243,11 +243,11 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
[
'foo' => [
'a' => [
'text' => 'text',
'count' => 1,
'key' => 1,
'number' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text',
'number' => 1,
]
]
],
@ -268,11 +268,11 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
[
'foo' => [
'a' => [
'text' => 'text',
'count' => 1,
'key' => 1,
'number' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text',
'number' => 1,
]
]
],
@ -293,11 +293,11 @@ class ReferenceStackTest extends MediaWikiUnitTestCase {
[
'foo' => [
'a' => [
'text' => 'text-1 cite_error_references_duplicate_key',
'count' => 1,
'key' => 1,
'number' => 1,
'dir' => 'rtl',
'key' => 1,
'text' => 'text-1 cite_error_references_duplicate_key',
'number' => 1,
]
]
],