Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
flowerinthenight committed Jul 17, 2024
1 parent 9e2687f commit 00fd13a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sos.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,12 +398,16 @@ func (r *Reader) Read(out chan []byte) {
func() {
r.sos.mlock.Lock()
defer r.sos.mlock.Unlock()
if _, ok := r.sos.data[node]; ok {
if r.sos.data[node].bufs != nil {
for i := 0; i < r.sos.data[node].bufs.Len(); i++ {
out <- r.sos.data[node].bufs.Value(i)
}
}
if _, ok := r.sos.data[node]; !ok {
return
}

if r.sos.data[node].bufs == nil {
return
}

for i := 0; i < r.sos.data[node].bufs.Len(); i++ {
out <- r.sos.data[node].bufs.Value(i)
}
}()

Expand Down

0 comments on commit 00fd13a

Please sign in to comment.