mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Optimize oldTagIssues method by reordering the checks (#9434)
The hasInterestingTags skips most entities and is light to run - in contrary to presetManager.match
This commit is contained in:
@@ -24,12 +24,14 @@ export function validationOutdatedTags() {
|
||||
|
||||
|
||||
function oldTagIssues(entity, graph) {
|
||||
const oldTags = Object.assign({}, entity.tags); // shallow copy
|
||||
let preset = presetManager.match(entity, graph);
|
||||
let subtype = 'deprecated_tags';
|
||||
if (!preset) return [];
|
||||
if (!entity.hasInterestingTags()) return [];
|
||||
|
||||
let preset = presetManager.match(entity, graph);
|
||||
if (!preset) return [];
|
||||
|
||||
const oldTags = Object.assign({}, entity.tags); // shallow copy
|
||||
let subtype = 'deprecated_tags';
|
||||
|
||||
// Upgrade preset, if a replacement is available..
|
||||
if (preset.replacement) {
|
||||
const newPreset = presetManager.item(preset.replacement);
|
||||
|
||||
Reference in New Issue
Block a user