From 9b4a1c6ba80ef96dd21b816b0b19fe5508cd668b Mon Sep 17 00:00:00 2001 From: Somnath Banerjee Date: Sun, 10 Sep 2023 22:26:28 +0530 Subject: [PATCH] Fix build (#1119) Seems like an parallel edits caused build to fail @mh0lt --- downloader/downloader.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/downloader/downloader.go b/downloader/downloader.go index 256c7be85..547446168 100644 --- a/downloader/downloader.go +++ b/downloader/downloader.go @@ -89,8 +89,9 @@ func (s *AggStats) clone() *AggStats { UploadRate: s.UploadRate, DownloadRate: s.DownloadRate, } - sc.DroppedCompleted.Store(s.DroppedCompleted.Load()) - sc.DroppedTotal.Store(s.DroppedTotal.Load()) + atomic.StoreUint64(&sc.DroppedCompleted, atomic.LoadUint64(&s.DroppedCompleted)) + atomic.StoreUint64(&sc.DroppedTotal, atomic.LoadUint64(&s.DroppedTotal)) + return sc } @@ -107,8 +108,9 @@ func (s *AggStats) copy(o *AggStats) *AggStats { s.BytesUpload = o.BytesUpload s.UploadRate = o.UploadRate s.DownloadRate = o.DownloadRate - s.DroppedCompleted.Store(o.DroppedCompleted.Load()) - s.DroppedTotal.Store(o.DroppedTotal.Load()) + atomic.StoreUint64(&s.DroppedCompleted, atomic.LoadUint64(&o.DroppedCompleted)) + atomic.StoreUint64(&s.DroppedTotal, atomic.LoadUint64(&o.DroppedTotal)) + return s }