Skip to content

Streamline Redundant Conditional Checks for Backfilling Block Number #40

@ametel01

Description

@ametel01

info!("[batch_index] Backfilling complete, terminating backfilling process.");

Description:
In the BatchIndexer::index method, there are redundant checks for the current_backfilling_block_number value:

  • The first check terminates the loop when current_backfilling_block_number equals 0.
  • Immediately following, an if-else block checks if current_backfilling_block_number is greater than 0; the else branch repeats the termination logic.

Since the non-positive case is already handled, the second else branch can be removed to simplify the control flow.

Proposed Fix:
Remove the redundant else branch. After the initial check for zero, you can safely assume that current_backfilling_block_number is positive in the subsequent conditional.

Impact:
Streamlines the logic, improves readability, and reduces unnecessary conditional branching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions