commit | e3718a87b7c33c8ae63a9c8967a85394262f5d94 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Tue Jun 07 15:29:31 2016 -0700 |
committer | Sho Shimizu <sho.shimizu@gmail.com> | Wed Jun 08 21:56:02 2016 +0000 |
tree | 6d7275a0093fb2ea359ff9a19fbe14c923c7aa4e | |
parent | 7838c51a4b2d281c7f3ad0104c1f2363f0550b93 [diff] |
Simplify method Change-Id: I3d04245fb5462e0750c3bcfa687946742d44644f
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/EncodableDiscreteResources.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/EncodableDiscreteResources.java index 061cf14..99352ac 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/EncodableDiscreteResources.java +++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/EncodableDiscreteResources.java
@@ -97,8 +97,7 @@ @Override public boolean containsAny(Set<DiscreteResource> other) { - return other.stream() - .anyMatch(x -> values().contains(x)); + return !Sets.intersection(this.values(), other).isEmpty(); } @Override
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/GenericDiscreteResources.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/GenericDiscreteResources.java index b8c8b2b..d35a477 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/GenericDiscreteResources.java +++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/GenericDiscreteResources.java
@@ -68,7 +68,7 @@ @Override public boolean containsAny(Set<DiscreteResource> other) { - return other.stream().anyMatch(values::contains); + return !Sets.intersection(this.values(), other).isEmpty(); } // returns a new instance, not mutate the current instance