Compute the midpoint between `a` and `b`. Return `None` if the midpoint would be equal to either.
(a: SequenceNumber, b: SequenceNumber)
| 89 | /// Compute the midpoint between `a` and `b`. |
| 90 | /// Return `None` if the midpoint would be equal to either. |
| 91 | fn midpoint(a: SequenceNumber, b: SequenceNumber) -> Option<SequenceNumber> { |
| 92 | debug_assert!(a < b); |
| 93 | // Avoid integer overflow. |
| 94 | let m = a + (b - a) / 2; |
| 95 | if m > a { Some(m) } else { None } |
| 96 | } |
| 97 | |
| 98 | impl Layout { |
| 99 | /// Compare the program points `a` and `b` in the same block relative to this program order. |