RFR: pr: use LinkedHashSet for CommitCommentsWorkItem

Robin Westberg rwestberg at openjdk.java.net
Fri Mar 19 09:44:40 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.
> Thanks,
> Erik

Looks good!


PR: https://git.openjdk.java.net/skara/pull/1081

More information about the skara-dev mailing list