mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
chore: use make([]byte, 6) and omit nil check
This commit is contained in:
parent
31ccfc4039
commit
de34abf766
1 changed files with 2 additions and 2 deletions
|
|
@ -573,7 +573,7 @@ func UnescapePunctuations(source []byte) []byte {
|
||||||
// ResolveNumericReferences resolve numeric references like 'Ӓ" .
|
// ResolveNumericReferences resolve numeric references like 'Ӓ" .
|
||||||
func ResolveNumericReferences(source []byte) []byte {
|
func ResolveNumericReferences(source []byte) []byte {
|
||||||
cob := NewCopyOnWriteBuffer(source)
|
cob := NewCopyOnWriteBuffer(source)
|
||||||
buf := make([]byte, 6, 6)
|
buf := make([]byte, 6)
|
||||||
limit := len(source)
|
limit := len(source)
|
||||||
ok := false
|
ok := false
|
||||||
n := 0
|
n := 0
|
||||||
|
|
@ -977,7 +977,7 @@ func (s *bytesFilter) Contains(b []byte) bool {
|
||||||
}
|
}
|
||||||
h := bytesHash(b) % uint64(len(s.slots))
|
h := bytesHash(b) % uint64(len(s.slots))
|
||||||
slot := s.slots[h]
|
slot := s.slots[h]
|
||||||
if slot == nil || len(slot) == 0 {
|
if len(slot) == 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for _, element := range slot {
|
for _, element := range slot {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue