Skip to content

Commit

Permalink
Don't loop through the flushed spans array needlessly
Browse files Browse the repository at this point in the history
  • Loading branch information
bidetofevil committed Mar 12, 2024
1 parent 303c83b commit f2bbde3
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ internal class SpanSinkImpl : SpanSink {
override fun flushSpans(): List<EmbraceSpanData> {
synchronized(spansToFlush) {
spansToFlush.set(completedSpans())
repeat(spansToFlush.get().size) {
completedSpans.removeAll(spansToFlush.get().toSet())
}
completedSpans.removeAll(spansToFlush.get().toSet())
return spansToFlush.get()
}
}
Expand Down

0 comments on commit f2bbde3

Please sign in to comment.