You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/03/16 18:53:03 UTC
[GitHub] [geode] dschneider-pivotal commented on a change in pull request #7431: GEODE-9946: Add Radish LREM command
dschneider-pivotal commented on a change in pull request #7431:
URL: https://github.com/apache/geode/pull/7431#discussion_r828340856
##########
File path: geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/collections/SizeableByteArrayList.java
##########
@@ -31,6 +33,57 @@
roundUpSize(getObjectHeaderSize() + 3 * getReferenceSize());
private int memberOverhead;
+ /**
+ * @param o element to remove from the list
+ * @param count number of elements that match object o to remove from the list.
+ * Count that is equal to 0 removes all matching elements from the list.
+ * @return list of indexes that were removed in order.
+ */
+ public List<Integer> removeObjectsStartingAtHead(Object o, int count) {
+ int index = 0;
+ ListIterator<byte[]> iterator = this.listIterator(index);
+ List<Integer> indexesRemoved = 0 < count ? new ArrayList<>(count) : new ArrayList<>();
Review comment:
maybe we just shouldn't presize it in this case since count is the max but the number we actually find could be much smaller
--
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-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org