Skip to content

Commit 26da5e3

Browse files
committed
refactor(lang): remove runeToUpper wrapper and use unicode.ToUpper directly
The runeToUpper() function was a simple wrapper around unicode.ToUpper() with only one call site. Removed the wrapper to simplify the code and call unicode.ToUpper() directly in splitCamel().
1 parent 24280b3 commit 26da5e3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

lang/util.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@ func runeIsUpper(r rune) bool {
2727
return r >= 'A' && r <= 'Z'
2828
}
2929

30-
func runeToUpper(r rune) rune {
31-
return unicode.ToUpper(r)
32-
}
33-
3430
func splitCamel(text string) string {
3531
var builder strings.Builder
3632
var previousRune rune
3733
var wordLength int
3834
for i, r := range text {
3935
if i == 0 {
40-
previousRune = runeToUpper(r)
36+
previousRune = unicode.ToUpper(r)
4137
continue
4238
}
4339

0 commit comments

Comments
 (0)