nonbinaryprogrammer commented on a change in pull request #7392:
URL: https://github.com/apache/geode/pull/7392#discussion_r815214420



##########
File path: 
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java
##########
@@ -135,6 +161,27 @@ public int getDSFID() {
     return REDIS_LIST_ID;
   }
 
+  public synchronized int elementInsert(byte[] elementToInsert, byte[] 
referenceElement,
+      boolean before) {
+    for (int i = 0; i < elementList.size(); i++) {
+      if (Arrays.equals(elementList.get(i), referenceElement)) {
+        if (before) {
+          elementList.add(i, elementToInsert);
+          return i;
+        } else {
+          elementList.add(i + 1, elementToInsert);
+          return i + 1;
+        }
+      }
+    }
+
+    return -1;
+  }
+
+  public synchronized void elementInsert(byte[] toInsert, int index) {

Review comment:
       this elementInsert is used when applying the delta. at that point the 
only information that we have is the index and the new value




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to