zyxxoo commented on code in PR #2134:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2134#discussion_r1119488229


##########
hugegraph-core/src/main/java/org/apache/hugegraph/backend/tx/GraphIndexTransaction.java:
##########
@@ -1120,21 +1120,25 @@ private static <T> boolean cmn(List<T> all, int m, int 
n,
             result = new ArrayList<>(n);
         }
 
+        int index = result.size();
         if (m == n) {
             result.addAll(all.subList(current, all.size()));
             n = 0;
         }
         if (n == 0) {
             // All n items are selected
-            return callback.apply(result);
+            Boolean apply = callback.apply(result);
+            while (index < result.size()) {
+                result.remove(index);

Review Comment:
   We can run the test:
   
![Screenshot2023_02_28_093728](https://user-images.githubusercontent.com/11863049/221730322-0ca30303-69ca-4951-9482-7cc010825804.jpg)
   the result is:
   
![Screenshot2023_02_28_093808](https://user-images.githubusercontent.com/11863049/221730416-9fb30fe3-51db-41cb-aa0d-a917995d117c.jpg)
   



-- 
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: dev-unsubscr...@hugegraph.apache.org

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

Reply via email to