mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-08 05:50:47 +00:00
Add method to convert reflist to list of strings. #116
This commit is contained in:
@@ -92,6 +92,17 @@ func (l *PackageRefList) Has(p *Package) bool {
|
|||||||
return i < len(l.Refs) && bytes.Compare(l.Refs[i], key) == 0
|
return i < len(l.Refs) && bytes.Compare(l.Refs[i], key) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Strings builds list of strings with package keys
|
||||||
|
func (l *PackageRefList) Strings() []string {
|
||||||
|
result := make([]string, l.Len())
|
||||||
|
|
||||||
|
for i := 0; i < l.Len(); i++ {
|
||||||
|
result[i] = string(l.Refs[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
// Substract returns all packages in l that are not in r
|
// Substract returns all packages in l that are not in r
|
||||||
func (l *PackageRefList) Substract(r *PackageRefList) *PackageRefList {
|
func (l *PackageRefList) Substract(r *PackageRefList) *PackageRefList {
|
||||||
result := &PackageRefList{Refs: make([][]byte, 0, 128)}
|
result := &PackageRefList{Refs: make([][]byte, 0, 128)}
|
||||||
|
|||||||
Reference in New Issue
Block a user