Remove branching in fastcheckLevel() in order to speedup the function

Is just a minor fix, but since I spotted it and the function is called fast*, I thought it is might worth doing ...
This commit is contained in:
Raskaro 2019-08-21 14:05:16 +02:00
parent f16bd27773
commit 150cede3f8

View file

@ -216,8 +216,5 @@ func ErrorTracef(ctx context.Context, things ...interface{}) (ok bool) {
}
func fastcheckLevel(level severity) bool {
if uint32(level) < atomic.LoadUint32(logLevel) {
return false
}
return true
return uint32(level) >= atomic.LoadUint32(logLevel)
}