diff options
-rw-r--r-- | src/analyzer.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/analyzer.js b/src/analyzer.js index a5b7169c..746037a9 100644 --- a/src/analyzer.js +++ b/src/analyzer.js @@ -946,25 +946,24 @@ function analyzer(data, sidePass) { label.allOutLabels = []; }); + // First, find allInLabels var worked = true; while (worked) { worked = false; labels.forEach(function(label) { - function inout(s, l) { - var temp = label[s]; - label[s].forEach(function(label2Id) { - temp = temp.concat(labelsDict[label2Id][l]); - }); - temp = dedup(temp); - if (temp.length > label[l].length) { - label[l] = temp; - worked = true; - } + var temp = label.inLabels; + label.inLabels.forEach(function(label2Id) { + temp = temp.concat(labelsDict[label2Id].allInLabels); + }); + temp = dedup(temp); + if (temp.length > label.allInLabels.length) { + label.allInLabels = temp; + worked = true; } - inout('inLabels', 'allInLabels'); }); } + // Infer allOutLabels from allInLabels, they are mirror images labels.forEach(function(label) { label.allInLabels.forEach(function(inLabelId) { labelsDict[inLabelId].allOutLabels.push(label.ident); |