syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject syncope git commit: Minor streams optimisation
Date Mon, 20 Nov 2017 12:35:44 GMT
Repository: syncope
Updated Branches:
  refs/heads/master 30d90566d -> f670e2fa3


Minor streams optimisation


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/f670e2fa
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/f670e2fa
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/f670e2fa

Branch: refs/heads/master
Commit: f670e2fa38d0862c9b5d15639e8fb8dee5770936
Parents: 30d9056
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Nov 20 12:35:33 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Nov 20 12:35:33 2017 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java  | 2 +-
 .../src/main/java/org/apache/syncope/core/logic/GroupLogic.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/f670e2fa/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
index 4e84455..fa3ca98 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/AbstractAnyLogic.java
@@ -229,7 +229,7 @@ public abstract class AbstractAnyLogic<TO extends AnyTO, P extends
AnyPatch> ext
                             ? groupDAO
                             : anyObjectDAO;
             authorized = anyDAO.findDynRealms(key).stream().
-                    filter(dynRealm -> effectiveRealms.contains(dynRealm)).findFirst().isPresent();
+                    anyMatch(dynRealm -> effectiveRealms.contains(dynRealm));
         }
         if (!authorized) {
             throw new DelegatedAdministrationException(

http://git-wip-us.apache.org/repos/asf/syncope/blob/f670e2fa/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
index 8d94807..103dae8 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/GroupLogic.java
@@ -122,7 +122,7 @@ public class GroupLogic extends AbstractAnyLogic<GroupTO, GroupPatch>
{
                 -> realm.startsWith(ownedRealm) || ownedRealm.equals(RealmUtils.getGroupOwnerRealm(realm,
key)));
         if (!authorized) {
             authorized = groupDAO.findDynRealms(key).stream().
-                    filter(dynRealm -> effectiveRealms.contains(dynRealm)).findFirst().isPresent();
+                    anyMatch(dynRealm -> effectiveRealms.contains(dynRealm));
         }
         if (!authorized) {
             throw new DelegatedAdministrationException(realm, AnyTypeKind.GROUP.name(), key);


Mime
View raw message