* Advance the internal state until we reach a non-empty bucket, or the end. */
| 470 | * Advance the internal state until we reach a non-empty bucket, or the end. |
| 471 | */ |
| 472 | void VehiclesNearTileXY::Iterator::SkipEmptyBuckets() |
| 473 | { |
| 474 | while (this->current_veh == nullptr) { |
| 475 | if (this->hx != this->hxmax) { |
| 476 | this->hx = IncTileHash1D(this->hx); |
| 477 | } else if (this->hy != this->hymax) { |
| 478 | this->hx = this->hxmin; |
| 479 | this->hy = IncTileHash1D(this->hy); |
| 480 | } else { |
| 481 | return; |
| 482 | } |
| 483 | this->current_veh = _vehicle_tile_hash[ComposeTileHash(this->hx, this->hy)]; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * Advance the internal state until it reaches a vehicle within the search area. |
no test coverage detected