From de34abf766e8371c84ccf263535385bb383ddbef Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 13 Jul 2023 13:38:58 +0800 Subject: [PATCH] chore: use make([]byte, 6) and omit nil check --- util/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/util.go b/util/util.go index 88d2538..bc421af 100644 --- a/util/util.go +++ b/util/util.go @@ -573,7 +573,7 @@ func UnescapePunctuations(source []byte) []byte { // ResolveNumericReferences resolve numeric references like 'Ӓ" . func ResolveNumericReferences(source []byte) []byte { cob := NewCopyOnWriteBuffer(source) - buf := make([]byte, 6, 6) + buf := make([]byte, 6) limit := len(source) ok := false n := 0 @@ -977,7 +977,7 @@ func (s *bytesFilter) Contains(b []byte) bool { } h := bytesHash(b) % uint64(len(s.slots)) slot := s.slots[h] - if slot == nil || len(slot) == 0 { + if len(slot) == 0 { return false } for _, element := range slot {