Skip to content

Commit

Permalink
ditch origin from interval (use array index instead)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slava0135 committed Sep 12, 2024
1 parent 8d2eb4e commit 6733941
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pkg/neotest/coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ type documentName = string

type interval struct {
compiler.DebugSeqPoint
origin int
remove bool
}

Expand Down Expand Up @@ -215,8 +214,8 @@ func documentSeqPoints(di *compiler.DebugInfo, doc documentName) []compiler.Debu
func resolveOverlaps(points []compiler.DebugSeqPoint) []compiler.DebugSeqPoint {
var intervals []interval
// expected maximum characters per line. Its more effective and easier to assume this, than to compare columns.
for i, p := range points {
intervals = append(intervals, interval{DebugSeqPoint: p, origin: i})
for _, p := range points {
intervals = append(intervals, interval{DebugSeqPoint: p})
}
for i := range intervals {
for j := range intervals {
Expand All @@ -239,9 +238,9 @@ func resolveOverlaps(points []compiler.DebugSeqPoint) []compiler.DebugSeqPoint {
}
}
var res []compiler.DebugSeqPoint
for _, v := range intervals {
for i, v := range intervals {
if !v.remove {
res = append(res, points[v.origin])
res = append(res, points[i])
}
}
return res
Expand Down

0 comments on commit 6733941

Please sign in to comment.