zeroshade commented on code in PR #693:
URL: https://github.com/apache/iceberg-go/pull/693#discussion_r2719313152


##########
table/scanner.go:
##########
@@ -272,10 +272,14 @@ func (scan *Scan) checkSequenceNumber(minSeqNum int64, 
manifest iceberg.Manifest
 }
 
 func minSequenceNum(manifests []iceberg.ManifestFile) int64 {
-       n := int64(0)
+       var n int64
+       found := false
        for _, m := range manifests {

Review Comment:
   Ah, I see what you mean. I feel like we could initialize `n` to `INT_MAX` to 
fix it and simplify, right?  Something like...
   
   ```go
   n := math.MaxInt64
   for _, m := range manifests {
       if m.ManifestContent() == iceberg.ManifestContentData {
           n = min(n, m.MinSequenceNum())
       }
   }
   
   if n == math.MaxInt64 {
       n = 0
   }
   
   return n
   ```
   
   I find that simpler to read than having the `found` check. Make sense?



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