optimize ShouldSkipHook

This commit is contained in:
sivyer9303 2021-07-30 22:32:35 +08:00
parent 577db27512
commit b0f419b02f

View File

@ -690,7 +690,7 @@ func (stmt *Statement) ShouldSkipHook(c *callback) (skip bool) {
}
}
// skip by func
if skip || len(stmt.SkipHooksFunc) > 0 {
if !skip && len(stmt.SkipHooksFunc) > 0 {
for _, hookFunc := range stmt.SkipHooksFunc {
// compare with ptr
if &hookFunc == &c.handler {
@ -700,4 +700,5 @@ func (stmt *Statement) ShouldSkipHook(c *callback) (skip bool) {
}
}
}
return
}