Fixed a bug where keys where serialised twice

This commit is contained in:
obscuren
2014-12-24 14:47:50 +01:00
parent 804af9658a
commit 58d477f7a6
4 changed files with 23 additions and 12 deletions

View File

@ -17,7 +17,7 @@ type Node interface {
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("%s ", self.data) }
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) }
// Full node
@ -36,5 +36,5 @@ func (self *FullNode) fstring(ind string) string {
// Short node
func (self *ShortNode) fstring(ind string) string {
return fmt.Sprintf("[ %s: %v ] ", self.key, self.value.fstring(ind+" "))
return fmt.Sprintf("[ %x: %v ] ", self.key, self.value.fstring(ind+" "))
}