Skip to content

Unnecessary continueLoop boolean reset #11

Description

@samuraii77

In DiamondLoupeFacet, we have a boolean continueLoop used to determine whether we should initialise the facet or not. If it is true, we end up here which skips the initialisation process below it as we have already been there before:

            if (continueLoop) {
                continueLoop = false;
                continue;
            }

The continueLoop reset to false is unnecessary as we do it on each new iteration anyway:

        for (uint256 selectorIndex; selectorIndex < selectorCount; selectorIndex++) {
            bytes4 selector = ds.selectors[selectorIndex];
            address facetAddress_ = ds.facetAddressAndSelectorPosition[selector].facetAddress;
            bool continueLoop = false;
            ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions