upstream sync

This commit is contained in:
Senad Uka
2023-10-12 05:23:34 +02:00
parent d3011d77ff
commit 7369739bdd
21 changed files with 1686 additions and 85 deletions

View File

@@ -0,0 +1,23 @@
package mapbox
import (
"bytes"
)
const (
slash = "/"
comma = ','
questionMark = "?"
equalMark = '='
ampersandMark = '&'
)
// encodeValues do almost the same as url.Values.Encode() but faster and reuses *strings.Builder
func encodeValues(buf *bytes.Buffer, values map[string]string) {
for k, v := range values {
buf.WriteByte(ampersandMark)
buf.WriteString(k)
buf.WriteByte(equalMark)
buf.WriteString(v)
}
}