mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-11-17 15:48:17 +01:00
Use strconv.FormatInt() directly to convert key to string w/o using expensive fmt.Sprintf().
This commit is contained in:
parent
6efb976ba2
commit
da5c70b55b
@ -5,7 +5,6 @@
|
|||||||
package common
|
package common
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -16,5 +15,5 @@ func DecodePosFromBytes(key []byte) (pos int64, err error) {
|
|||||||
|
|
||||||
// Encode a block pos to byte slice.
|
// Encode a block pos to byte slice.
|
||||||
func EncodePosToBytes(key int64) []byte {
|
func EncodePosToBytes(key int64) []byte {
|
||||||
return []byte(fmt.Sprintf("%d", key))
|
return []byte(strconv.FormatInt(key, 10))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user