From 6b5f26722aa60b3f428a930e9d7eebce8f514c9d Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 25 Aug 2015 13:00:27 +0000
Subject: [PATCH] Use Collection.contains()

---
 opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
index abe553b..bdbc409 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -400,21 +400,15 @@
     for (final SortKey sortKey : sortOrder.getSortKeys())
     {
       final AttributeType attributeType = sortKey.getAttributeType();
-      final Iterable<AttributeType> subTypes = DirectoryServer.getSchema().getSubTypes(attributeType);
+      final List<AttributeType> subTypes = DirectoryServer.getSchema().getSubTypes(attributeType);
       for (final Modification mod : mods)
       {
         final AttributeType modAttrType = mod.getAttribute().getAttributeType();
-        if (modAttrType.equals(attributeType))
+        if (modAttrType.equals(attributeType)
+            || subTypes.contains(modAttrType))
         {
           return true;
         }
-        for (final AttributeType subType : subTypes)
-        {
-          if (modAttrType.equals(subType))
-          {
-            return true;
-          }
-        }
       }
     }
     return false;

--
Gitblit v1.10.0