Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Simplify Commit List sorting logic #8364

Closed
Tracked by #7210
bobanm opened this issue Apr 15, 2023 · 0 comments · Fixed by #8365
Closed
Tracked by #7210

Simplify Commit List sorting logic #8364

bobanm opened this issue Apr 15, 2023 · 0 comments · Fixed by #8365
Assignees

Comments

@bobanm
Copy link
Contributor

bobanm commented Apr 15, 2023

Some minor improvements to Commit List sorting logic:

  1. ascendingHeight is not an appropriate argument for the argument passed to CommitList.getAll(), where the argument defines sorting order.
  2. Instead of having 2 different sort commands in CommitList.getAll() based on argument value, this could be reduced to 1 command with a smarter use of COMMIT_SORT constant values.
  3. It's not needed to use sort order argument in CommitPool._getAllCommits(), as ascending is the default sort order of CommitList.getAll().
  4. CommitList.deleteByHeight() has an unusual conditional, which checks for an element which was deleted on the very previous line, and then tries to delete it again [?!].
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant