Skip to content

Commit

Permalink
simplify and remove auxiliary function
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Mar 7, 2024
1 parent b2d22d9 commit bb9dc02
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions internal/slicer/slicer.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ func Run(options *RunOptions) (*Report, error) {

// We only want to keep the entries that were explicitly listed
// in the slice definition.
if !isListedInSlice(extractInfo, slice) {
if extractInfo == nil {
return nil
}
if _, ok := slice.Contents[extractInfo.Path]; !ok {
return nil
}

Expand Down Expand Up @@ -339,15 +342,3 @@ func contains(l []string, s string) bool {
}
return false
}

func isListedInSlice(extractInfo *deb.ExtractInfo, slice *setup.Slice) bool {
if extractInfo == nil {
return false
}
for path := range slice.Contents {
if extractInfo.Path == path {
return true
}
}
return false
}

0 comments on commit bb9dc02

Please sign in to comment.