refactor: optimized refresh logic after update fields for hash type

This commit is contained in:
Lykin
2023-11-17 16:26:03 +08:00
parent d88fd35e9d
commit 80e659e03a
9 changed files with 308 additions and 220 deletions

View File

@@ -5,6 +5,7 @@ import (
)
func containsBinary(str string) bool {
//buf := []byte(str)
//size := 0
//for start := 0; start < len(buf); start += size {
// var r rune
@@ -14,9 +15,25 @@ func containsBinary(str string) bool {
//}
rs := []rune(str)
for _, r := range rs {
if !unicode.IsPrint(r) && r != '\n' {
if !unicode.IsPrint(r) && !unicode.IsSpace(r) {
return true
}
}
return false
}
func isSameChar(str string) bool {
if len(str) <= 0 {
return false
}
rs := []rune(str)
first := rs[0]
for _, r := range rs {
if r != first {
return false
}
}
return true
}