mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-11 13:53:16 +00:00
moving "func min" to MinInt in utils
This commit is contained in:
@@ -913,7 +913,7 @@ func (manager *SnapshotManager) CheckSnapshots(snapshotID string, revisionsToChe
|
|||||||
if earliestSeenChunks[chunkID] == 0 {
|
if earliestSeenChunks[chunkID] == 0 {
|
||||||
earliestSeenChunks[chunkID] = math.MaxInt64
|
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.
|
// ConvertSequence converts a sequence of chunk hashes into a sequence of chunk ids.
|
||||||
func (manager *SnapshotManager) ConvertSequence(sequence []string) (result []string) {
|
func (manager *SnapshotManager) ConvertSequence(sequence []string) (result []string) {
|
||||||
result = make([]string, len(sequence))
|
result = make([]string, len(sequence))
|
||||||
|
|||||||
@@ -427,3 +427,10 @@ func AtoSize(sizeString string) (int) {
|
|||||||
|
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MinInt(x, y int) (int) {
|
||||||
|
if x < y {
|
||||||
|
return x
|
||||||
|
}
|
||||||
|
return y
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user