mirror of
				https://bitbucket.org/s_l_teichmann/mtsatellite
				synced 2025-10-31 08:05:27 +01:00 
			
		
		
		
	Use strconv.FormatInt() directly to convert key to string w/o using expensive fmt.Sprintf().
This commit is contained in:
		| @@ -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)) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user