rdblue commented on a change in pull request #1110:
URL: https://github.com/apache/iceberg/pull/1110#discussion_r439695661



##########
File path: core/src/main/java/org/apache/iceberg/TableMetadata.java
##########
@@ -253,14 +253,21 @@ public String toString() {
     for (HistoryEntry logEntry : snapshotLog) {
       if (last != null) {
         Preconditions.checkArgument(
-            (logEntry.timestampMillis() - last.timestampMillis()) >= 0,
+            (logEntry.timestampMillis() - last.timestampMillis()) >= 
-ONE_MINUTE,
             "[BUG] Expected sorted snapshot log entries.");
       }
       last = logEntry;
     }
+    if (last != null) {

Review comment:
       Rather than wrapping a precondition in an if, it's shorter to add an or:
   
   ```java
   Preconditions.checkArgument(last == null || lastUpdatedMillis - 
last.timestampMillis() >= -ONE_MINUTE, ...);
   ```




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

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