sourcegraph/sourcegraph-public-snapshot

insights: refactor capture group methods for readability and performance

Aberta

#33.148 aberto em 28 de mar. de 2022

 (11 comentários) (0 reação) (0 responsável)Go (1.374 forks)auto 404
backendcode-insightsgood first issue

Métricas do repositório

Stars
 (10.290 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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.

Guia do colaborador