// Remove all ancestors on the path indicated by prefix from the Branchs cache
Remove all ancestors on the path indicated by prefix from the Branchs cache
// Remove all ancestors on the path indicated by prefix from the Branchs cache
func (n *TreeNode) clearAncestors(prefix []byte) error {
	if len(prefix) == 0 {
		return nil
	}
	l := len(prefix)
	if l >= ValueKeyLength {
		prefix = prefix[:3]
		l = 3
	}
	for i := 0; i < l; i++ {
		if prefix[i] > 0x1 {
			return common.ErrIllegalParams
		}
	}
	for i := 0; i <= l; i++ {
		delete(n.Branchs, string(prefix[:l-i]))
	}
	return nil
}
func ( n * TreeNode ) clearAncestors ( prefix [ ] byte ) error { if len ( prefix ) == 0 { return nil } l := len ( prefix ) if l >= ValueKeyLength { prefix = prefix [ : 3 ] l = 3 } for i := 0 ; i < l ; i ++ { if prefix [ i ] > 0x1 { return common . ErrIllegalParams } } for i := 0 ; i <= l ; i ++ { delete ( n . Branchs , string ( prefix [ : l - i ] ) ) } return nil }
Remove all ancestors on the path indicated by prefix from the Branchs cache
Remove all ancestors on the path indicated by prefix from the Branchs cache