Repository navigation
Commit e9c5d48
authored
4.x: Fix Streamable.intervalRange emitting nothing when start + count overflows (#8398)
intervalRange accepts start + count == Long.MAX_VALUE + 1, for example
start = 1 with count = Long.MAX_VALUE, which the Javadoc suggests for an
unlimited range. The streamer stored end = start + count, which wraps to
Long.MIN_VALUE, so counterLocal >= end held right away and the sequence
completed empty. Compare against the end through a subtraction so the
wrapped end still works, as Flowable.intervalRange does with c == end.1 parent ca68c46 commit e9c5d48
2 files changed
Lines changed: 19 additions & 2 deletions
File tree
- src
- main/java/io/reactivex/rxjava4/internal/operators/streamable
- test/java/io/reactivex/rxjava4/internal/operators/streamable
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
319 | 336 | | |
320 | 337 | | |
321 | 338 | | |
| |||
0 commit comments