little refactor
Some checks failed
Benchmark BufferPool / RunBenchmarks (push) Failing after 17s
Run Tests / Test (push) Failing after 15s

This commit is contained in:
2024-07-30 22:58:51 +02:00
parent 39c7876ed1
commit f5e263752e
2 changed files with 25 additions and 15 deletions

View File

@@ -3,7 +3,6 @@ package encoding
import (
"bytes"
"fmt"
"log"
)
type GSM7Coder struct{}
@@ -63,7 +62,6 @@ func (c *GSM7Coder) Encode(s string, buf *bytes.Buffer) error {
offset = 1
}
}
log.Println(buf.Cap(), buf.Len())
return nil
}
@@ -74,7 +72,7 @@ func (c *GSM7Coder) Decode(buf *bytes.Buffer) (string, error) {
bitshift byte = 0
leap, shift bool
)
outLength := DecodesInto(buf)
outLength := GSM7DecodesInto(buf)
lengthDiff := outLength - len(gsm7)
gsm7 = append(gsm7, make([]byte, lengthDiff)...)
@@ -144,7 +142,7 @@ func InsertAt(data *[]byte, index int, value byte) {
(*data)[index] = value
}
func EncodesInto(s *string) int {
func GSM7EncodesInto(s *string) int {
slen := len(*s)
enclen := slen * 7 / 8
if slen%8 != 0 {
@@ -152,7 +150,7 @@ func EncodesInto(s *string) int {
}
return enclen
}
func DecodesInto(buf *bytes.Buffer) int {
func GSM7DecodesInto(buf *bytes.Buffer) int {
blen := buf.Len()
declen := blen * 8 / 7
return declen