Copilot commented on code in PR #6527:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6527#discussion_r2550641383


##########
drools-core/src/main/java/org/drools/core/phreak/PhreakNodeOperations.java:
##########
@@ -230,6 +230,34 @@ public static void doUpdatesReorderLeftMemory(BetaMemory 
bm,
         }
     }
     
+    public static void doUpdatesExistentialReorderLeftMemory(BetaMemory bm,
+                                                             TupleSets 
srcLeftTuples) {
+        TupleMemory ltm = bm.getLeftTupleMemory();
+
+        // sides must first be re-ordered, to ensure iteration integrity
+        for (TupleImpl leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple 
!= null; leftTuple = leftTuple.getStagedNext()) {
+            if (leftTuple.getMemory() != null) {
+                ltm.remove(leftTuple);
+            }
+        }
+
+        for (TupleImpl leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple 
!= null; leftTuple = leftTuple.getStagedNext()) {
+            RightTuple blocker = leftTuple.getBlocker();
+            if (blocker == null) {
+                ltm.add(leftTuple);
+                for (TupleImpl childLeftTuple = leftTuple.getFirstChild(); 
childLeftTuple != null;) {
+                    TupleImpl childNext = childLeftTuple.getHandleNext();
+                    childLeftTuple.reAddRight();
+                    childLeftTuple = childNext;
+                }
+            } else if (blocker.getStagedType() != LeftTuple.NONE) {
+                // it's blocker is also being updated, so remove to force it 
to start from the beginning

Review Comment:
   Grammar error: "it's" should be "its" (possessive form, not contraction of 
"it is").
   ```suggestion
                   // its blocker is also being updated, so remove to force it 
to start from the beginning
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to