compare provides a function to compare object path, each set of sibling objects in one level of the containment hierarchy (all child objects under a storage object) is represented as a red-black tree. The parent object of this set of siblings will have a pointer to the top of this tree.
(left, right string)
| 712 | // a storage object) is represented as a red-black tree. The parent object of |
| 713 | // this set of siblings will have a pointer to the top of this tree. |
| 714 | func (c *cfb) compare(left, right string) int { |
| 715 | L, R, i, j := strings.Split(left, "/"), strings.Split(right, "/"), 0, 0 |
| 716 | for Z := int(math.Min(float64(len(L)), float64(len(R)))); i < Z; i++ { |
| 717 | if j = len(L[i]) - len(R[i]); j != 0 { |
| 718 | return j |
| 719 | } |
| 720 | if L[i] != R[i] { |
| 721 | if L[i] < R[i] { |
| 722 | return -1 |
| 723 | } |
| 724 | return 1 |
| 725 | } |
| 726 | } |
| 727 | return len(L) - len(R) |
| 728 | } |
| 729 | |
| 730 | // prepare provides a function to prepare object before write stream. |
| 731 | func (c *cfb) prepare() { |
no outgoing calls