Don't add function names multiple times
@@ -553,12 +553,13 @@ public class ConvertedModel {
if (node instanceof ReferenceNode) {
ReferenceNode referenceNode = (ReferenceNode)node;
if (referenceNode.getOutput() == null) { // function references cannot specify outputs
- names.add(referenceNode.getName());
+ if (names.add(referenceNode.getName())) {
if (model.functions().containsKey(referenceNode.getName())) {
addFunctionNamesIn(RankingExpression.from(model.functions().get(referenceNode.getName())).getRoot(), names, model);
}
}
}
+ }
else if (node instanceof CompositeNode) {
for (ExpressionNode child : ((CompositeNode)node).children())
addFunctionNamesIn(child, names, model);
