From 801602d7fa0aba9e5987683d26725daf91885c18 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 10 Jul 2015 08:26:35 +0000
Subject: [PATCH] Code cleanup

---
 opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
index 74b5297..4b86808 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
@@ -48,6 +48,7 @@
 import org.opends.server.types.AttributeType;
 import org.forgerock.opendj.ldap.ByteString;
 import org.opends.server.types.Attributes;
+import org.forgerock.opendj.ldap.ByteSequence;
 import org.forgerock.opendj.ldap.ByteSequenceReader;
 import org.forgerock.opendj.ldap.ByteStringBuilder;
 import org.opends.server.types.DirectoryException;
@@ -120,22 +121,19 @@
     if (numValues == 1 && options.isEmpty())
     {
       final int valueLength = reader.getBERLength();
-      final ByteString valueBytes = reader.getByteSequence(valueLength)
-          .toByteString();
-      return Attributes.create(attrType, valueBytes);
+      final ByteSequence valueBytes = reader.getByteSequence(valueLength);
+      return Attributes.create(attrType, valueBytes.toByteString());
     }
     else
     {
       // Read the appropriate number of values.
       final AttributeBuilder builder = new AttributeBuilder(attrType);
       builder.setOptions(options);
-      builder.setInitialCapacity(numValues);
       for (int i = 0; i < numValues; i++)
       {
         final int valueLength = reader.getBERLength();
-        final ByteString valueBytes = reader.getByteSequence(valueLength)
-            .toByteString();
-        builder.add(valueBytes);
+        final ByteSequence valueBytes = reader.getByteSequence(valueLength);
+        builder.add(valueBytes.toByteString());
       }
       return builder.toAttribute();
     }

--
Gitblit v1.10.0