Commit 3ca5faa
Speed up
The previous implementation modeled `Complement` as the intersection of the complements of the comprising intervals. However, since we already invoke `Intervals()` in this function, it only applies when the `IntervalSet` is already normalized... at which point, we can be more efficient by scanning linearly through the sorted list of non-abutting intervals & recording the unused values.
PiperOrigin-RevId: 678405288IntervalSet::Complement.1 parent 145799a commit 3ca5faa
1 file changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
303 | | - | |
304 | | - | |
305 | | - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
306 | 309 | | |
307 | | - | |
308 | | - | |
309 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
310 | 317 | | |
311 | | - | |
312 | | - | |
| 318 | + | |
313 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
314 | 325 | | |
315 | 326 | | |
316 | 327 | | |
| |||
0 commit comments