mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-23 14:22:58 +03:00
perf(textarea): amortize heap allocs in Value
(#212)
This commit is contained in:
parent
9b67fb8724
commit
e72e4a190b
@ -271,13 +271,13 @@ func (m Model) Value() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
var v string
|
||||
var v strings.Builder
|
||||
for _, l := range m.value {
|
||||
v += string(l)
|
||||
v += "\n"
|
||||
v.WriteString(string(l))
|
||||
v.WriteByte('\n')
|
||||
}
|
||||
|
||||
return strings.TrimSuffix(v, "\n")
|
||||
return strings.TrimSuffix(v.String(), "\n")
|
||||
}
|
||||
|
||||
// Length returns the number of characters currently in the text input.
|
||||
|
Loading…
Reference in New Issue
Block a user