Skip to content

Commit

Permalink
refactor(filter): remove unnecessary check
Browse files Browse the repository at this point in the history
the prototype filters should be checked inside the compare function before each filter and modifier
function execution, thus, only values should be checked inside filters and modifiers
  • Loading branch information
Alexander Yukal committed Jan 18, 2024
1 parent 4fab961 commit 47523c6
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ func filterEach(action string, proto, value reflect.Value) string {
func filterDate(action string, proto, value reflect.Value) string {
var tmProto, tmValue int64

if proto.Equal(refNil) {
return MsgInvalidRule
}

if value.Equal(refNil) {
return MsgInvalidValue
}
Expand Down Expand Up @@ -444,10 +440,6 @@ func filterTime(action string, proto, value reflect.Value) string {
var tmProto, tmValue int64
var err error

if proto.Equal(refNil) {
return MsgInvalidRule
}

if value.Equal(refNil) {
return MsgInvalidValue
}
Expand Down

0 comments on commit 47523c6

Please sign in to comment.