Skip to content

Commit 824de97

Browse files
committed
Extract variable
1 parent 0f71c5c commit 824de97

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All notable changes to **ValueStringBuilder** will be documented in this file. T
2020

2121
## [0.5.3] - 2022-12-28
2222

23-
\### Changed
23+
### Changed
2424

2525
- Smaller internal refactorings
2626

stringbuilder.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ func NewStringBuilder(initialCapacity int) *StringBuilder {
1414

1515
// Creates a new instance of the StringBuilder with a preallocated text
1616
func NewStringBuilderFromString(text string) *StringBuilder {
17+
textRunes := []rune(text)
1718
return &StringBuilder{
18-
data: []rune(text),
19-
position: len([]rune(text)),
19+
data: textRunes,
20+
position: len(textRunes),
2021
}
2122
}
2223

0 commit comments

Comments
 (0)