[TASK] Avoid unnassary loops in domain name mapping
This commit is contained in:
parent
77c94a1f2e
commit
8fdc8dcabb
@ -9,5 +9,6 @@ rules:
|
|||||||
"func-names": 0
|
"func-names": 0
|
||||||
"guard-for-in": 0
|
"guard-for-in": 0
|
||||||
"no-undefined": 0
|
"no-undefined": 0
|
||||||
|
"consistent-return": 0
|
||||||
"no-nested-ternary": 0
|
"no-nested-ternary": 0
|
||||||
"no-extend-native": ["error", { "exceptions": ["String"] }]
|
"no-extend-native": ["error", { "exceptions": ["String"] }]
|
||||||
|
@ -110,9 +110,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
|
|||||||
|
|
||||||
var domainDict = count(nodes, ['domain'], function (d) {
|
var domainDict = count(nodes, ['domain'], function (d) {
|
||||||
if (config.domainNames) {
|
if (config.domainNames) {
|
||||||
config.domainNames.forEach(function (t) {
|
config.domainNames.some(function (t) {
|
||||||
if (d === t.domain) {
|
if (d === t.domain) {
|
||||||
d = t.name;
|
d = t.name;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -71,9 +71,10 @@ define(['snabbdom', 'helper', 'moment'], function (V, helper, moment) {
|
|||||||
self.showDomain = function showDomain(d) {
|
self.showDomain = function showDomain(d) {
|
||||||
var rt = d.domain;
|
var rt = d.domain;
|
||||||
if (config.domainNames) {
|
if (config.domainNames) {
|
||||||
config.domainNames.forEach(function (t) {
|
config.domainNames.some(function (t) {
|
||||||
if (d.domain === t.domain) {
|
if (rt === t.domain) {
|
||||||
rt = t.name;
|
rt = t.name;
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user