1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-06 00:03:38 +00:00

moving "func min" to MinInt in utils

This commit is contained in:
Arno Hautala
2017-09-19 01:06:08 -04:00
parent e2fe57e959
commit f1fe64b9cc
2 changed files with 8 additions and 9 deletions

View File

@@ -913,7 +913,7 @@ func (manager *SnapshotManager) CheckSnapshots(snapshotID string, revisionsToChe
if earliestSeenChunks[chunkID] == 0 {
earliestSeenChunks[chunkID] = math.MaxInt64
}
earliestSeenChunks[chunkID] = min(earliestSeenChunks[chunkID], snapshot.Revision)
earliestSeenChunks[chunkID] = MinInt(earliestSeenChunks[chunkID], snapshot.Revision)
}
}
@@ -982,14 +982,6 @@ func (manager *SnapshotManager) CheckSnapshots(snapshotID string, revisionsToChe
}
func min(x, y int) int {
if x < y {
return x
}
return y
}
// ConvertSequence converts a sequence of chunk hashes into a sequence of chunk ids.
func (manager *SnapshotManager) ConvertSequence(sequence []string) (result []string) {
result = make([]string, len(sequence))

View File

@@ -427,3 +427,10 @@ func AtoSize(sizeString string) (int) {
return size
}
func MinInt(x, y int) (int) {
if x < y {
return x
}
return y
}