beryllw commented on code in PR #1770:
URL: https://github.com/apache/fluss/pull/1770#discussion_r2387056398


##########
fluss-lake/fluss-lake-iceberg/src/main/java/org/apache/fluss/lake/iceberg/tiering/IcebergLakeCommitter.java:
##########
@@ -314,8 +313,8 @@ private Snapshot getCommittedLatestSnapshotOfLake(String 
commitUser) {
         List<Snapshot> snapshots = (List<Snapshot>) icebergTable.snapshots();
         // snapshots() returns snapshots in chronological order (oldest to 
newest), Reverse to find
         // most recent snapshot committed by Fluss
-        Collections.reverse(snapshots);
-        for (Snapshot snapshot : snapshots) {
+        for (int i = snapshots.size() - 1; i >= 0; i--) {

Review Comment:
   Agree with the fix. Just curious - in what scenarios would 
icebergTable.snapshots() return an ImmutableList? In our unit tests, it's 
returning an ArrayList, which works with Collections.reverse().



-- 
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]

Reply via email to