Commit 55e7924a authored by Yulin Chen's avatar Yulin Chen

Reorder functions in trie

parent 5b66601c
......@@ -86,16 +86,6 @@ func (p *PrefixTrie) Remove(network net.IPNet) (*net.IPNet, error) {
return p.remove(rnet.NewNetwork(network))
}
func (p *PrefixTrie) childrenCount() int {
count := 0
for _, child := range p.children {
if child != nil {
count++
}
}
return count
}
// Contains returns boolean indicating whether given ip is contained in any
// of the inserted networks.
func (p *PrefixTrie) Contains(ip net.IP) (bool, error) {
......@@ -257,6 +247,16 @@ func (p *PrefixTrie) remove(network rnet.Network) (*net.IPNet, error) {
return nil, nil
}
func (p *PrefixTrie) childrenCount() int {
count := 0
for _, child := range p.children {
if child != nil {
count++
}
}
return count
}
func (p *PrefixTrie) targetBitPosition() uint {
return 31 - p.numBitsSkipped
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment