From db93ec4b30becada5f744e1ab625edbd9129a570 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 07 Apr 2015 15:56:59 +0000
Subject: [PATCH] Code cleanup
---
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 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 7014e6e..4e2279f 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
@@ -568,20 +568,12 @@
}
else
{
- /*
- * Treat an non-matching assertion as matching beyond the end of the index.
- */
+ // Treat a non-matching assertion as matching beyond the end of the index.
targetPosition = currentCount;
}
searchOperation.addResponseControl(new VLVResponseControl(targetPosition + 1, currentCount,
LDAPResultCode.SUCCESS));
- final long[] result = new long[selectedIDs.size()];
- int i = 0;
- for (Long entryID : selectedIDs)
- {
- result[i++] = entryID;
- }
- return newDefinedSet(result);
+ return newDefinedSet(toPrimitiveLongArray(selectedIDs));
}
finally
{
@@ -589,6 +581,17 @@
}
}
+ private long[] toPrimitiveLongArray(final List<Long> entryIDs)
+ {
+ final long[] result = new long[entryIDs.size()];
+ int i = 0;
+ for (Long entryID : entryIDs)
+ {
+ result[i++] = entryID;
+ }
+ return result;
+ }
+
/**
* Normalize the assertion using the primary key's ordering matching rule.
*/
--
Gitblit v1.10.0