RFR: pr: use LinkedHashSet for CommitCommentsWorkItem
rwestberg at openjdk.java.net
Fri Mar 19 10:04:41 UTC 2021
On Fri, 19 Mar 2021 08:32:32 GMT, Erik Helin <ehelin at openjdk.org> wrote:
> Hi all,
> please review this patch that uses a `LinkedHashSet` instead of a regular `HashSet` for storing the hashes associated with a certain commit message title for the `CommitCommandsWorkItem`. This will increase the likelihood for `GitLabRepository.commitWithComment` finding the commit quicker, since `GitRepository.commitMetadataFor` will return metadata with the most recent commit first and the `LinkedHashSet` will return elements in insertion order when iterating over it. The effect is that `GitLabRepository.commitWithComment` will consider the candidates in chronological order with the most recent candidate first. This maps well to how contributors are likely to use commit commands - it will most likely be rare that someone makes a commit command on a very old commit.
Marked as reviewed by rwestberg (Reviewer).
More information about the skara-dev