MinKey is adjusted to make sure no add overflow would happen in test cases. e.g. A gap with range {MinInt32, 2} would cause overflow in Range().Length(). Normally Keys should be unsigned to avoid these issues.
()
| 46 | // |
| 47 | // Normally Keys should be unsigned to avoid these issues. |
| 48 | func (s gapSetFunctions) MinKey() int { |
| 49 | return s.setFunctions.MinKey() / 2 |
| 50 | } |
| 51 | |
| 52 | // MaxKey returns the maximum key for the set. |
| 53 | func (s gapSetFunctions) MaxKey() int { |