default values removed

This commit is contained in:
obscuren
2015-01-29 23:17:43 +01:00
parent bd992e7baf
commit 9022f5034f
4 changed files with 25 additions and 17 deletions

View File

@ -49,7 +49,7 @@ func CompactDecode(str string) []byte {
func CompactHexDecode(str string) []byte {
base := "0123456789abcdef"
hexSlice := make([]byte, 0)
var hexSlice []byte
enc := hex.EncodeToString([]byte(str))
for _, v := range enc {
@ -61,7 +61,7 @@ func CompactHexDecode(str string) []byte {
}
func DecodeCompact(key []byte) string {
base := "0123456789abcdef"
const base = "0123456789abcdef"
var str string
for _, v := range key {
@ -70,7 +70,7 @@ func DecodeCompact(key []byte) string {
}
}
res, _ := hex.DecodeString(str)
res, err := hex.DecodeString(str)
return string(res)
}

View File

@ -18,7 +18,7 @@ func (self *ValueNode) String() string { return self.fstring("") }
func (self *FullNode) String() string { return self.fstring("") }
func (self *ShortNode) String() string { return self.fstring("") }
func (self *ValueNode) fstring(ind string) string { return fmt.Sprintf("%x ", self.data) }
func (self *HashNode) fstring(ind string) string { return fmt.Sprintf("%x ", self.key) }
func (self *HashNode) fstring(ind string) string { return fmt.Sprintf("< %x > ", self.key) }
// Full node
func (self *FullNode) fstring(ind string) string {