Skip to content

Commit 4acbfb7

Browse files
committed
perf: avoid trying to match release against patterns for type it already has been assigned
1 parent d9946d8 commit 4acbfb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

harmonizer/release_types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ const releaseGroupTypeMatchers: Array<{ type?: ReleaseGroupType; pattern: RegExp
5656
export function guessTypesFromTitle(title: string): Set<ReleaseGroupType> {
5757
const types = new Set<ReleaseGroupType>();
5858
releaseGroupTypeMatchers.forEach((matcher) => {
59+
if (matcher.type && types.has(matcher.type)) {
60+
// Release has already been assigned this type.
61+
return;
62+
}
63+
5964
const match = title.match(matcher.pattern);
6065
if (!match) {
6166
return;

0 commit comments

Comments
 (0)