Skip to content

Commit

Permalink
replace MakeMapIfNilAndSet
Browse files Browse the repository at this point in the history
  • Loading branch information
marcovidonis committed Oct 15, 2024
1 parent 8777cb7 commit f165ff2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webtorrent/tracker-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ func (tc *TrackerClient) announce(event tracker.AnnounceEvent, infoHash [20]byte
return fmt.Errorf("write AnnounceRequest: %w", err)
}
tc.updateTrackerAnnounceStatus(announceStatus)
g.MakeMapIfNil(&tc.outboundOffers)
for _, offer := range offers {
g.MakeMapIfNilAndSet(&tc.outboundOffers, offer.offerId, offer.outboundOfferValue)
g.MapInsert(tc.outboundOffers, offer.offerId, offer.outboundOfferValue)
}
return nil
}
Expand Down

0 comments on commit f165ff2

Please sign in to comment.