Skip to content

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: kata-containers#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 Oct 9, 2020
1 parent 92ffecf commit a7ac8e4
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 @@ -189,18 +189,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 a7ac8e4

Please sign in to comment.