From da5c70b55beaae305f334bddc1a65474a48b7ffc Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sun, 17 Aug 2014 12:08:26 +0200 Subject: [PATCH] Use strconv.FormatInt() directly to convert key to string w/o using expensive fmt.Sprintf(). --- common/coords.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/coords.go b/common/coords.go index dce9b46..dc57e6e 100644 --- a/common/coords.go +++ b/common/coords.go @@ -5,7 +5,6 @@ package common import ( - "fmt" "strconv" ) @@ -16,5 +15,5 @@ func DecodePosFromBytes(key []byte) (pos int64, err error) { // Encode a block pos to byte slice. func EncodePosToBytes(key int64) []byte { - return []byte(fmt.Sprintf("%d", key)) + return []byte(strconv.FormatInt(key, 10)) }