package trie import "fmt" var indices = []string{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "[17]"} type Node interface { Value() Node Copy(*Trie) Node // All nodes, for now, return them self Dirty() bool fstring(string) string Hash() interface{} RlpData() interface{} } // Value node 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("%v", self.trie.trans(self)) } // Full node func (self *FullNode) fstring(ind string) string { resp := fmt.Sprintf("[\n%s ", ind) for i, node := range self.nodes { if node == nil { resp += fmt.Sprintf("%s: ", indices[i]) } else { resp += fmt.Sprintf("%s: %v", indices[i], node.fstring(ind+" ")) } } return resp + fmt.Sprintf("\n%s] ", ind) } // Short node func (self *ShortNode) fstring(ind string) string { return fmt.Sprintf("[ %x: %v ] ", self.key, self.value.fstring(ind+" ")) } 97593b'/> FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/devel/alog
Commit message (Expand)AuthorAgeFilesLines
* devel/alog: not jobs safemarino2014-11-011-0/+2
* devel/alog: Remove reference to base/full flavors in pkg-descrmarino2014-10-171-6/+0
* net/alog: Upgrade version 0.4.1 => 0.5.0marino2014-10-163-128/+18
* marino 12 devel ports: Remove @dirrm, tend install commands, plusmarino2014-10-16