Skip to content

Commit b32ed86

Browse files
committed
feat: shrink repeated patterns
1 parent 0bcbabf commit b32ed86

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chat/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ func AskCustom[T any](grp int64, f func(int, string) T) []T {
4949
func Sanitize(msg string) string {
5050
i := strings.LastIndex(msg, "】")
5151
if i > 0 {
52-
if i+1 >= len(msg) {
52+
if i+len("】") >= len(msg) {
5353
return ""
5454
}
55-
msg = msg[i+1:]
55+
msg = msg[i+len("】"):]
5656
} else {
5757
i = strings.LastIndex(msg, "]")
5858
if i > 0 {

0 commit comments

Comments
 (0)