Simplify boolean some comparisons
This commit is contained in:
parent
cfed5cfe4b
commit
48061f1508
@ -687,7 +687,7 @@ func (r AndRule) Evaluate(headers, query, payload *map[string]interface{}, body
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = res && rv
|
res = res && rv
|
||||||
if res == false {
|
if !res {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -709,7 +709,7 @@ func (r OrRule) Evaluate(headers, query, payload *map[string]interface{}, body *
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = res || rv
|
res = res || rv
|
||||||
if res == true {
|
if res {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ func main() {
|
|||||||
|
|
||||||
newHooksFiles := hooksFiles[:0]
|
newHooksFiles := hooksFiles[:0]
|
||||||
for _, filePath := range hooksFiles {
|
for _, filePath := range hooksFiles {
|
||||||
if _, ok := loadedHooksFromFiles[filePath]; ok == true {
|
if _, ok := loadedHooksFromFiles[filePath]; ok {
|
||||||
newHooksFiles = append(newHooksFiles, filePath)
|
newHooksFiles = append(newHooksFiles, filePath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -436,7 +436,7 @@ func reloadHooks(hooksFilePath string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchLoadedHook(hook.ID) != nil && !wasHookIDAlreadyLoaded) || seenHooksIds[hook.ID] == true {
|
if (matchLoadedHook(hook.ID) != nil && !wasHookIDAlreadyLoaded) || seenHooksIds[hook.ID] {
|
||||||
log.Printf("error: hook with the id %s has already been loaded!\nplease check your hooks file for duplicate hooks ids!", hook.ID)
|
log.Printf("error: hook with the id %s has already been loaded!\nplease check your hooks file for duplicate hooks ids!", hook.ID)
|
||||||
log.Println("reverting hooks back to the previous configuration")
|
log.Println("reverting hooks back to the previous configuration")
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user