From 325694f2762f303c4cf229200d76569be722f36e Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 18 Apr 2007 15:41:59 +0000
Subject: [PATCH] Make a number of minor changes identified through profiling as potential performance improvements.

---
 opends/src/server/org/opends/server/backends/jeb/DN2URI.java |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/DN2URI.java b/opends/src/server/org/opends/server/backends/jeb/DN2URI.java
index 554a9be..bdb9356 100644
--- a/opends/src/server/org/opends/server/backends/jeb/DN2URI.java
+++ b/opends/src/server/org/opends/server/backends/jeb/DN2URI.java
@@ -674,8 +674,7 @@
      * reverse order we must set the first byte (the comma).
      * No possibility of overflow here.
      */
-    byte[] end = suffix.clone();
-    end[0] = (byte) (end[0] + 1);
+    byte[] end = null;
 
     DatabaseEntry data = new DatabaseEntry();
     DatabaseEntry key = new DatabaseEntry(suffix);
@@ -692,6 +691,12 @@
              status == OperationStatus.SUCCESS;
              status = cursor.getNextNoDup(key, data, LockMode.DEFAULT))
         {
+          if (end == null)
+          {
+            end = suffix.clone();
+            end[0] = (byte) (end[0] + 1);
+          }
+
           int cmp = comparator.compare(key.getData(), end);
           if (cmp >= 0)
           {

--
Gitblit v1.10.0