Fix potential performance issue reported by FindBugs
diff --git a/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinksResource.java b/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinksResource.java
index c522a05..3c97e6a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinksResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/linkdiscovery/web/LinksResource.java
@@ -3,6 +3,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import net.floodlightcontroller.routing.Link;
@@ -23,8 +24,9 @@
if (ld != null) {
links.putAll(ld.getLinks());
- for (Link link: links.keySet()) {
- LinkInfo info = links.get(link);
+ for(Entry<Link, LinkInfo> e : links.entrySet()) {
+ Link link = e.getKey();
+ LinkInfo info = e.getValue();
LinkWithType lwt = new LinkWithType(link,
info.getSrcPortState(),
info.getDstPortState(),