File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ func Summary(inputPath string) (map[string]int, error) {
208208
209209 // Count occurrences of each error type
210210 counts := make (map [string ]int )
211- for _ , line := range strings .Split (string (data ), "\n " ) {
211+ for line := range strings .SplitSeq (string (data ), "\n " ) {
212212 if line == "" {
213213 continue
214214 }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import (
2424 "fmt"
2525 "os"
2626 "path/filepath"
27+ "slices"
2728 "sort"
2829 "strings"
2930
@@ -176,7 +177,7 @@ func readAndAggregate(filename string) (map[string]*CallSite, error) {
176177 }
177178
178179 // Add unique samples (up to 10 for LCS computation)
179- if len (site .Samples ) < 10 && ! containsString (site .Samples , entry .ErrorMsg ) {
180+ if len (site .Samples ) < 10 && ! slices . Contains (site .Samples , entry .ErrorMsg ) {
180181 site .Samples = append (site .Samples , entry .ErrorMsg )
181182 }
182183 }
@@ -195,15 +196,6 @@ func normalizePath(path string) string {
195196 return filepath .Base (path )
196197}
197198
198- func containsString (slice []string , s string ) bool {
199- for _ , item := range slice {
200- if item == s {
201- return true
202- }
203- }
204- return false
205- }
206-
207199// longestCommonSubstring finds the longest substring common to all strings.
208200func longestCommonSubstring (strs []string ) string {
209201 if len (strs ) == 0 {
You can’t perform that action at this time.
0 commit comments