Skip to content

Commit

Permalink
Removed extra loop that is no longer needed
Browse files Browse the repository at this point in the history
Signed-off-by: John <john.dorman@sony.com>
  • Loading branch information
boostchicken authored and jpkrohling committed Jan 18, 2022
1 parent 7c26c95 commit 138dbd6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions processor/filterprocessor/filter_processor_traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,12 @@ func (fsp *filterSpanProcessor) processTraces(_ context.Context, pdt pdata.Trace
resSpan := pdt.ResourceSpans().At(i)
for x := 0; x < resSpan.InstrumentationLibrarySpans().Len(); x++ {
ils := resSpan.InstrumentationLibrarySpans().At(x)
for spanCount := 0; spanCount < ils.Spans().Len(); spanCount++ {
ils.Spans().RemoveIf(func(span pdata.Span) bool {
return !fsp.shouldKeepSpan(span, resSpan.Resource(), ils.InstrumentationLibrary())
})
}
ils.Spans().RemoveIf(func(span pdata.Span) bool {
return !fsp.shouldKeepSpan(span, resSpan.Resource(), ils.InstrumentationLibrary())
})
}
resSpan.InstrumentationLibrarySpans().RemoveIf(func(spans pdata.InstrumentationLibrarySpans) bool {
return spans.Spans().Len() == 0
resSpan.InstrumentationLibrarySpans().RemoveIf(func(ilsSpans pdata.InstrumentationLibrarySpans) bool {
return ilsSpans.Spans().Len() == 0
})
}
if pdt.ResourceSpans().Len() == 0 {
Expand Down

0 comments on commit 138dbd6

Please sign in to comment.