()
| 227 | func (si SliceIndex) Type() reflect.Type { return si.typ } |
| 228 | func (si SliceIndex) Values() (vx, vy reflect.Value) { return si.vx, si.vy } |
| 229 | func (si SliceIndex) String() string { |
| 230 | switch { |
| 231 | case si.xkey == si.ykey: |
| 232 | return fmt.Sprintf("[%d]", si.xkey) |
| 233 | case si.ykey == -1: |
| 234 | // [5->?] means "I don't know where X[5] went" |
| 235 | return fmt.Sprintf("[%d->?]", si.xkey) |
| 236 | case si.xkey == -1: |
| 237 | // [?->3] means "I don't know where Y[3] came from" |
| 238 | return fmt.Sprintf("[?->%d]", si.ykey) |
| 239 | default: |
| 240 | // [5->3] means "X[5] moved to Y[3]" |
| 241 | return fmt.Sprintf("[%d->%d]", si.xkey, si.ykey) |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | // Key is the index key; it may return -1 if in a split state |
| 246 | func (si SliceIndex) Key() int { |
nothing calls this directly
no outgoing calls
no test coverage detected