mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-01 04:45:27 +01:00
18 lines
354 B
Go
18 lines
354 B
Go
|
package pruning
|
||
|
|
||
|
func filterSnapList(snaps []Snapshot, predicate func(Snapshot) bool) []Snapshot {
|
||
|
r := make([]Snapshot, 0, len(snaps))
|
||
|
for i := range snaps {
|
||
|
if predicate(snaps[i]) {
|
||
|
r = append(r, snaps[i])
|
||
|
}
|
||
|
}
|
||
|
return r
|
||
|
}
|
||
|
|
||
|
func shallowCopySnapList(snaps []Snapshot) []Snapshot {
|
||
|
c := make([]Snapshot, len(snaps))
|
||
|
copy(c, snaps)
|
||
|
return c
|
||
|
}
|