Skip to content

Commit 1c287c1

Browse files
authored
Add MaxTXID() for file info slices (#58)
1 parent 975b56e commit 1c287c1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ltx.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,3 +600,12 @@ func (a FileInfoSlice) Less(i, j int) bool {
600600
}
601601
return a[i].MinTXID < a[j].MinTXID
602602
}
603+
604+
// MaxTXID returns the MaxTXID of the last element in the slice.
605+
// Returns zero if the slice is empty.
606+
func (a FileInfoSlice) MaxTXID() TXID {
607+
if len(a) == 0 {
608+
return 0
609+
}
610+
return a[len(a)-1].MaxTXID
611+
}

0 commit comments

Comments
 (0)