mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 08:01:56 +00:00
perf: count bot comments without a filtered array (#20343)
Co-authored-by: Orca Worker <orca-worker@localhost>
This commit is contained in:
@@ -55,7 +55,12 @@ export function getPRCommentAudienceCounts(
|
||||
comments: readonly PRComment[],
|
||||
botAuthorOverrides?: ReadonlySet<string>
|
||||
): Record<PRCommentAudienceFilter, number> {
|
||||
const bot = comments.filter((comment) => isBotPRComment(comment, botAuthorOverrides)).length
|
||||
let bot = 0
|
||||
comments.forEach((comment) => {
|
||||
if (isBotPRComment(comment, botAuthorOverrides)) {
|
||||
bot += 1
|
||||
}
|
||||
})
|
||||
return { all: comments.length, human: comments.length - bot, bot }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user