diff options
Diffstat (limited to 'android/neverallow.go')
| -rw-r--r-- | android/neverallow.go | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/android/neverallow.go b/android/neverallow.go index 48581df71..0cb20296c 100644 --- a/android/neverallow.go +++ b/android/neverallow.go @@ -407,8 +407,8 @@ func (r *rule) String() string { } func (r *rule) appliesToPath(dir string) bool { - includePath := len(r.paths) == 0 || hasAnyPrefix(dir, r.paths) - excludePath := hasAnyPrefix(dir, r.unlessPaths) + includePath := len(r.paths) == 0 || HasAnyPrefix(dir, r.paths) + excludePath := HasAnyPrefix(dir, r.unlessPaths) return includePath && !excludePath } @@ -474,15 +474,6 @@ func fieldNamesForProperties(propertyNames string) []string { return names } -func hasAnyPrefix(s string, prefixes []string) bool { - for _, prefix := range prefixes { - if strings.HasPrefix(s, prefix) { - return true - } - } - return false -} - func hasAnyProperty(properties []interface{}, props []ruleProperty) bool { for _, v := range props { if hasProperty(properties, v) { |