If we match a generic name, stop looking

This is for "nextbike"
(re: https://github.com/osmlab/name-suggestion-index/issues/4543#issuecomment-796126041)
This commit is contained in:
Bryan Housel
2021-03-11 17:51:09 -05:00
parent 98a622f41a
commit d282140999
+1 -1
View File
@@ -426,7 +426,7 @@ function _upgradeTags(tags, loc) {
const hits = _nsi.matcher.match(tuple.k, tuple.v, tuple.n, loc); // Attempt to match an item in NSI
if (!hits || !hits.length) continue; // no match, try next tuple
if (hits[0].match !== 'primary' && hits[0].match !== 'alternate') continue; // a generic match, try next tuple
if (hits[0].match !== 'primary' && hits[0].match !== 'alternate') break; // a generic match, stop looking
// A match may contain multiple results, the first one is likely the best one for this location
// e.g. `['pfk-a54c14', 'kfc-1ff19c', 'kfc-658eea']`