Find the index where this SnapPoint should go in sorted order, between i0 (inclusive) and i1 (exclusive).
| 136 | // Find the index where this SnapPoint should go in |
| 137 | // sorted order, between i0 (inclusive) and i1 (exclusive). |
| 138 | size_t SnapManager::Find(double t, size_t i0, size_t i1) |
| 139 | { |
| 140 | if (i1 <= i0 + 1) |
| 141 | { |
| 142 | return i0; |
| 143 | } |
| 144 | |
| 145 | size_t half = (i0 + i1) / 2; |
| 146 | |
| 147 | if (t < Get(half)) |
| 148 | { |
| 149 | return Find(t, i0, half); |
| 150 | } |
| 151 | |
| 152 | return Find(t, half, i1); |
| 153 | } |
| 154 | |
| 155 | // Find the SnapPoint nearest to time t |
| 156 | size_t SnapManager::Find(double t) |
no test coverage detected