sourcegraph/sourcegraph-public-snapshot

insights: refactor capture group methods for readability and performance

开放

#33,148 创建于 2022年3月28日

 (11 条评论) (0 个反应) (0 位负责人)Go (1,374 个派生)auto 404
backendcode-insightsgood first issue

仓库指标

星标
 (10,290 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

When a capture group insight is created, we tally up matches per capture group using MatchValues and Counts methods on ComputeMatchContext. We then group them in the method GroupByCaptureMatch.

The current logic uses many nested for loops. The aim of this ticket is to look into simplifying this logic. What we want at the end is a map of unique capture group values to their count.

贡献者指南