github.com/benz9527/xboot@v0.0.0-20240504061247-c23f15593274/lib/tree/rbdirection_string.go (about)

     1  // Code generated by "stringer -type=RBDirection"; DO NOT EDIT.
     2  
     3  package tree
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[Left - -1]
    12  	_ = x[Root-0]
    13  	_ = x[Right-1]
    14  }
    15  
    16  const _RBDirection_name = "LeftRootRight"
    17  
    18  var _RBDirection_index = [...]uint8{0, 4, 8, 13}
    19  
    20  func (i RBDirection) String() string {
    21  	i -= -1
    22  	if i < 0 || i >= RBDirection(len(_RBDirection_index)-1) {
    23  		return "RBDirection(" + strconv.FormatInt(int64(i+-1), 10) + ")"
    24  	}
    25  	return _RBDirection_name[_RBDirection_index[i]:_RBDirection_index[i+1]]
    26  }