Skip to content
Snippets Groups Projects
Unverified Commit 8fdc8dca authored by Xaver Maierhofer's avatar Xaver Maierhofer
Browse files

[TASK] Avoid unnassary loops in domain name mapping

parent 77c94a1f
No related branches found
No related tags found
No related merge requests found
...@@ -9,5 +9,6 @@ rules: ...@@ -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 ...@@ -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) { ...@@ -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;
} }
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment