A lil optimize
This commit is contained in:
@@ -15,6 +15,10 @@ func (c *GSM7Coder) Encode(s string, buf *bytes.Buffer) error {
|
|||||||
bitshift byte = 0
|
bitshift byte = 0
|
||||||
leap, shift bool
|
leap, shift bool
|
||||||
)
|
)
|
||||||
|
tbw := len(utf8) * 7 / 8
|
||||||
|
if buf.Available() < tbw {
|
||||||
|
buf.Grow(tbw)
|
||||||
|
}
|
||||||
|
|
||||||
for index, septet := range utf8 {
|
for index, septet := range utf8 {
|
||||||
if septet > 0b01111111 {
|
if septet > 0b01111111 {
|
||||||
|
Reference in New Issue
Block a user