Skip to content

Commit 96a7699

Browse files
committed
#72 Call moji.Squeeze() to remove redundant space characters
1 parent 03a1003 commit 96a7699

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lhost/order.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
package lhost
1010
import "strings"
11+
import "libsisimai.org/sisimai/moji"
1112

1213
var defaultorder = []string{
1314
// There are another patterns in the value of "Subject:" header of a bounce mail generated by
@@ -67,10 +68,7 @@ func OrderBySubject(title string) []string {
6768
// The following order is decided by the first 2 words of Subject: header
6869
for _, e := range []string{"[", "]", "_"} { title = strings.Replace(title, e, " ", -1) }
6970

70-
// Squeeze duplicated space characters
71-
for strings.Contains(title, " ") { title = strings.ReplaceAll(title, " ", " ") }
72-
73-
title = strings.TrimSpace(title) // Remove leading space characters
71+
if strings.Contains(title, " ") { title = moji.Squeeze(title, ' ') }
7472
words := strings.SplitN(strings.ToLower(title), " ", 3)
7573
first := ""
7674

0 commit comments

Comments
 (0)