mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-28 00:40:12 +00:00
Remove dead extra comparison from VE JavaScript code
The first code snippet in this while already covers this case. The loop will end the moment it can't find another parent any more. This was found via https://sonarcloud.io/project/issues?id=mediawiki-extensions-Cite&types=BUG as a potential bug. After looking at the code I'm sure it's not one. Change-Id: Id914252c88b27420dfa47dcc918fc58d9ee2a65d
This commit is contained in:
parent
e834fbe25e
commit
d622356a73
|
@ -212,11 +212,12 @@ ve.ce.MWReferencesListNode.prototype.update = function () {
|
|||
return false;
|
||||
}
|
||||
// Exclude references defined inside the references list node
|
||||
while ( ( node = node.parent ) && node !== null ) {
|
||||
do {
|
||||
node = node.parent;
|
||||
if ( node instanceof ve.dm.MWReferencesListNode ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} while ( node );
|
||||
return true;
|
||||
} );
|
||||
|
||||
|
|
Loading…
Reference in a new issue