commit | 4c7fcdff5f4a5e706f0902462d4a63191f35c8a9 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Dec 22 11:17:43 2016 -0800 |
committer | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Dec 22 11:17:43 2016 -0800 |
tree | 6ee6ae8a3a263a86a7cb3ef65e673ef901c3fd44 | |
parent | d0598ee4edd96b952e5b4af0f0ad6107ecb2ca8f [diff] |
Use more functional idiom Change-Id: I125dcb795b8b9dc7651a5b5891c4687368530db7
diff --git a/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java b/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java index c150e26..e19044e 100644 --- a/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java +++ b/core/net/src/main/java/org/onosproject/net/resource/impl/LabelAllocator.java
@@ -213,11 +213,9 @@ */ public Map<LinkKey, Identifier<?>> assignLabelToLinks(Set<Link> links, IntentId id, EncapsulationType type) { - Set<LinkKey> linkRequest = Sets.newHashSet(); - - links.forEach(link -> { - linkRequest.add(LinkKey.linkKey(link)); - }); + Set<LinkKey> linkRequest = links.stream() + .map(LinkKey::linkKey) + .collect(Collectors.toSet()); Map<LinkKey, Identifier<?>> availableIds = findAvailableIDs(linkRequest, type); if (availableIds.isEmpty()) {