Save memory consumption by avoding unnecessary instantiation
Change-Id: I7ce66c11136653fabc490aa7f33fdadf4454d2cc
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java
index e6a20f7..2cf4ccb 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalPathIntentCompiler.java
@@ -46,7 +46,7 @@
import org.onosproject.net.resource.ResourceType;
import org.onosproject.net.topology.TopologyService;
-import java.util.Arrays;
+import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -88,7 +88,8 @@
Set<LinkResourceAllocations> resources) {
LinkResourceAllocations allocations = assignWavelength(intent);
- return Arrays.asList(new FlowRuleIntent(appId, createRules(intent, allocations), intent.resources()));
+ return Collections.singletonList(
+ new FlowRuleIntent(appId, createRules(intent, allocations), intent.resources()));
}
private LinkResourceAllocations assignWavelength(OpticalPathIntent intent) {