Skip to content

Commit 045d083

Browse files
committed
fix QF1001: could apply De Morgan's law
1 parent 16a1bd9 commit 045d083

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

label_sync/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ type labelCSSData struct {
975975
func cssEscape(s string) (escaped string) {
976976
var IsAlpha = regexp.MustCompile(`^[a-zA-Z]+$`).MatchString
977977
for i, c := range s {
978-
if (i == 0 && unicode.IsDigit(c)) || !(unicode.IsDigit(c) || IsAlpha(string(c))) {
978+
if (i == 0 && unicode.IsDigit(c)) || (!unicode.IsDigit(c) && !IsAlpha(string(c))) {
979979
escaped += fmt.Sprintf("x%0.6x", c)
980980
continue
981981
}

0 commit comments

Comments
 (0)