Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
annotations: Give better names to local variabes in search functions
Browse files Browse the repository at this point in the history
Use more meaningful variable names for clarity.

Fixes: #3004

Suggested-by: James O.D. Hunt james.o.hunt@intel.com>
Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
  • Loading branch information
c3d committed Nov 10, 2020
1 parent 58de2c5 commit d412a7f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions virtcontainers/pkg/oci/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,18 @@ func containerMounts(spec specs.Spec) []vc.Mount {
return mnts
}

func contains(s []string, e string) bool {
for _, a := range s {
if a == e {
func contains(strings []string, toFind string) bool {
for _, candidate := range strings {
if candidate == toFind {
return true
}
}
return false
}

func regexpContains(s []string, e string) bool {
for _, a := range s {
if matched, _ := regexp.MatchString(a, e); matched {
func regexpContains(regexps []string, toMatch string) bool {
for _, candidate := range regexps {
if matched, _ := regexp.MatchString(candidate, toMatch); matched {
return true
}
}
Expand Down

0 comments on commit d412a7f

Please sign in to comment.