mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-12-31 02:26:36 +08:00
优化代码
This commit is contained in:
@@ -362,13 +362,13 @@ func (this *Rule) Test(value interface{}) bool {
|
||||
return types.Float64(value) != this.floatValue
|
||||
case RuleOperatorEqString:
|
||||
if this.IsCaseInsensitive {
|
||||
return strings.ToLower(types.String(value)) == strings.ToLower(this.Value)
|
||||
return strings.EqualFold(types.String(value), this.Value)
|
||||
} else {
|
||||
return types.String(value) == this.Value
|
||||
}
|
||||
case RuleOperatorNeqString:
|
||||
if this.IsCaseInsensitive {
|
||||
return strings.ToLower(types.String(value)) != strings.ToLower(this.Value)
|
||||
return !strings.EqualFold(types.String(value), this.Value)
|
||||
} else {
|
||||
return types.String(value) != this.Value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user