1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

refactor: clean code

This commit is contained in:
dudaodong
2023-10-30 17:55:18 +08:00
parent bda78201f5
commit 6497b321b0

View File

@@ -32,8 +32,10 @@ func splitIntoStrings(s string, upperCase bool) []string {
for i := 0; i < len(runes)-1; i++ { for i := 0; i < len(runes)-1; i++ {
if isUpper(runes[i][0]) && isLower(runes[i+1][0]) { if isUpper(runes[i][0]) && isLower(runes[i+1][0]) {
runes[i+1] = append([]rune{runes[i][len(runes[i])-1]}, runes[i+1]...) length := len(runes[i]) - 1
runes[i] = runes[i][:len(runes[i])-1] temp := runes[i][length]
runes[i+1] = append([]rune{temp}, runes[i+1]...)
runes[i] = runes[i][:length]
} }
} }