From da7eec061560d498abfb2eb261f59ca41e84a4bd Mon Sep 17 00:00:00 2001
From: Chris Ridd <chris.ridd@forgerock.com>
Date: Mon, 29 Apr 2013 17:07:14 +0000
Subject: [PATCH] CR-1620 Partial fix OPENDJ-888 Maintaining ds-sync-hist for a large group is inefficient

---
 opends/src/server/org/opends/server/replication/plugin/AttrHistoricalSingle.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/plugin/AttrHistoricalSingle.java b/opends/src/server/org/opends/server/replication/plugin/AttrHistoricalSingle.java
index 8cc59ea..debaef9 100644
--- a/opends/src/server/org/opends/server/replication/plugin/AttrHistoricalSingle.java
+++ b/opends/src/server/org/opends/server/replication/plugin/AttrHistoricalSingle.java
@@ -27,7 +27,7 @@
  */
 package org.opends.server.replication.plugin;
 
-import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 
 import org.opends.server.replication.common.ChangeNumber;
@@ -70,17 +70,18 @@
    * {@inheritDoc}
    */
   @Override
-  public ArrayList<AttrValueHistorical> getValuesHistorical()
+  public HashMap<AttrValueHistorical,AttrValueHistorical> getValuesHistorical()
   {
     if (addTime == null)
     {
-      return new ArrayList<AttrValueHistorical>();
+      return new HashMap<AttrValueHistorical,AttrValueHistorical>(0);
     }
     else
     {
-      ArrayList<AttrValueHistorical> values =
-        new ArrayList<AttrValueHistorical>();
-      values.add(new AttrValueHistorical(value, addTime, null));
+      HashMap<AttrValueHistorical,AttrValueHistorical> values =
+        new HashMap<AttrValueHistorical,AttrValueHistorical>(1);
+      AttrValueHistorical val = new AttrValueHistorical(value, addTime, null);
+      values.put(val, val);
       return values;
     }
   }

--
Gitblit v1.10.0