Merge "Remove confusing, unnecessary .length check on a string"

This commit is contained in:
jenkins-bot 2024-03-27 08:15:09 +00:00 committed by Gerrit Code Review
commit 7906b2147a

View file

@ -134,7 +134,7 @@ ve.ui.MWReferenceSearchWidget.prototype.buildIndex = function () {
const itemNode = this.internalList.getItemNode( refModel.getListIndex() );
const refGroup = refModel.getGroup();
const citation = ( refGroup && refGroup.length ? refGroup + ' ' : '' ) + n;
const citation = ( refGroup ? refGroup + ' ' : '' ) + n;
// Use [\s\S]* instead of .* to catch esoteric whitespace (T263698)
const matches = refModel.getListKey().match( /^literal\/([\s\S]*)$/ );
const name = matches && matches[ 1 ] || '';