Skip to content

Sorting twice? #5

@PavloMcBlister

Description

@PavloMcBlister

At the end of findRotorConfiguration, the keySet is sorted in reverse order, then when the keySet.stream() is returned, it is also sorted in reverse order. It doesn't seem like the .sorted() would be needed on the returned stream() since the keySet is already sorted.

FYI: On my M1 Mac mini with 8 cores, the optimized version runs in about 4.3 seconds.

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