()
| 344 | C lastValue; |
| 345 | |
| 346 | @Override |
| 347 | protected C computeNext() { |
| 348 | while (merged.hasNext()) { |
| 349 | C next = merged.next(); |
| 350 | boolean duplicate = lastValue != null && comparator.compare(next, lastValue) == 0; |
| 351 | |
| 352 | // Keep looping till we find a non-duplicate value. |
| 353 | if (!duplicate) { |
| 354 | lastValue = next; |
| 355 | return lastValue; |
| 356 | } |
| 357 | } |
| 358 | lastValue = null; // clear reference to unused data |
| 359 | return endOfData(); |
| 360 | } |
| 361 | }; |
| 362 | } |
| 363 |