collector: fix comment and remove redundant parentheses (#2691)

Signed-off-by: cui fliter <imcusg@gmail.com>
This commit is contained in:
cui fliter 2023-05-18 00:04:50 +08:00 committed by GitHub
parent 184a4e0893
commit 287414bc65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,8 +34,8 @@ func newDeviceFilter(ignoredPattern, acceptPattern string) (f deviceFilter) {
return
}
// ignores returns whether the device should be ignored
// ignored returns whether the device should be ignored
func (f *deviceFilter) ignored(name string) bool {
return ((f.ignorePattern != nil && f.ignorePattern.MatchString(name)) ||
(f.acceptPattern != nil && !f.acceptPattern.MatchString(name)))
return (f.ignorePattern != nil && f.ignorePattern.MatchString(name)) ||
(f.acceptPattern != nil && !f.acceptPattern.MatchString(name))
}