A lil optimize

This commit is contained in:
2024-07-30 22:15:36 +02:00
parent 9fbcdd86cc
commit db61da9fc2
2 changed files with 24 additions and 20 deletions

View File

@@ -15,6 +15,10 @@ func (c *GSM7Coder) Encode(s string, buf *bytes.Buffer) error {
bitshift byte = 0
leap, shift bool
)
tbw := len(utf8) * 7 / 8
if buf.Available() < tbw {
buf.Grow(tbw)
}
for index, septet := range utf8 {
if septet > 0b01111111 {