Skip to content

Petty Suggestion #1

@Mark-Maplarge

Description

@Mark-Maplarge

This code:

int checkLength = k % 2 == 0 ? k / 2 : k / 2 + 1;

can instead be:

int checkLength = (k + 1) % 2;

This saves a branch.

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