mirror of
https://github.com/restic/restic.git
synced 2026-10-08 11:27:12 +00:00
Add Index.Packs() and IDSet.Equals()
This commit is contained in:
1 parent
4b1a2caea7
commit
d9f9b77d68
3 files changed
+49
No files matched your search
@@ -39,6 +39,27 @@ func (s IDSet) List() IDs {
|
||||
return list
|
||||
}
|
||||
|
||||
// Equals returns true iff s equals other.
|
||||
func (s IDSet) Equals(other IDSet) bool {
|
||||
if len(s) != len(other) {
|
||||
return false
|
||||
}
|
||||
|
||||
for id := range s {
|
||||
if _, ok := other[id]; !ok {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for id := range other {
|
||||
if _, ok := s[id]; !ok {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func (s IDSet) String() string {
|
||||
str := s.List().String()
|
||||
if len(str) < 2 {
|
||||
|
||||
Reference in new issue
Block a user