优化代码

This commit is contained in:
GoEdgeLab
2023-12-05 16:28:10 +08:00
parent cadac28975
commit 3d61f1a110

View File

@@ -86,9 +86,6 @@ func MatchBytesCache(regex *re.Regexp, byteSlice []byte, cacheLife CacheLife) bo
cacheHits.IncreaseHit(regIdString) cacheHits.IncreaseHit(regIdString)
return item.Value == 1 return item.Value == 1
} }
if item != nil {
return item.Value == 1
}
var b = regex.Match(byteSlice) var b = regex.Match(byteSlice)
if b { if b {
cache.Write(key, 1, fasttime.Now().Unix()+cacheLife) cache.Write(key, 1, fasttime.Now().Unix()+cacheLife)