Simplify duplicate lookup DOI match guard

The Array.prototype.find() predicate already guarantees a non-empty DOI present in doiSet, so the extra doiSet.has() check in the following if-condition is redundant.
This commit is contained in:
Shallow 2026-07-04 07:09:56 +08:00
parent bc733a14a8
commit 5d65c64ea1
No known key found for this signature in database

View file

@ -504,7 +504,7 @@ Zotero.Server.Connector.findExistingItemsByIdentifiers = async function (identif
item.getField('DOI'),
item.getExtraField('DOI')
].map(doi => Zotero.Utilities.cleanDOI(doi)).find(doi => doi && doiSet.has(doi.toLowerCase()));
if (itemDOI && doiSet.has(itemDOI.toLowerCase())) {
if (itemDOI) {
matchedFields.push('DOI');
matchedIdentifiers.doi = itemDOI;
}