Integrated: pr: use LinkedHashSet for CommitCommentsWorkItem

Erik Helin ehelin 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.
> 
> Thanks,
> Erik

This pull request has now been integrated.

Changeset: 77107ba1
Author:    Erik Helin <ehelin at openjdk.org>
URL:       https://git.openjdk.java.net/skara/commit/77107ba1
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

pr: use LinkedHashSet for CommitCommentsWorkItem

Reviewed-by: rwestberg

-------------

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


More information about the skara-dev mailing list