RFR: pr: use LinkedHashSet for CommitCommentsWorkItem

Erik Helin ehelin at openjdk.java.net
Fri Mar 19 08:35:15 UTC 2021

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.



Commit messages:
 - pr: use LinkedHashSet for CommitCommentsWorkItem

Changes: https://git.openjdk.java.net/skara/pull/1081/files
 Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1081&range=00
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/skara/pull/1081.diff
  Fetch: git fetch https://git.openjdk.java.net/skara pull/1081/head:pull/1081

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

More information about the skara-dev mailing list