summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-07-08 15:22:26 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-07-08 22:54:52 +1000
commit015a04fac6df267f0ba3a1abb1df35f5e18afec7 (patch)
treedb6bf334ea6ce924e3f0dc0b7830bca8ddd2d10b
parent26ca41a40e3ee79a3e84542ff6cf3fd3f2745679 (diff)
Remove redundant waitgroup
Turns out we're just running our refresh functions one after the other which isn't ideal but we can fix that separately. As it stands this wait group isn't doing anything.
-rw-r--r--pkg/gui/controllers/helpers/refresh_helper.go18
1 files changed, 5 insertions, 13 deletions
diff --git a/pkg/gui/controllers/helpers/refresh_helper.go b/pkg/gui/controllers/helpers/refresh_helper.go
index 67e6dc909..5c5e470b3 100644
--- a/pkg/gui/controllers/helpers/refresh_helper.go
+++ b/pkg/gui/controllers/helpers/refresh_helper.go
@@ -63,8 +63,6 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
)
}
- wg := sync.WaitGroup{}
-
f := func() {
var scopeSet *set.Set[types.RefreshableView]
if len(options.Scope) == 0 {
@@ -87,15 +85,11 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
}
refresh := func(f func()) {
- wg.Add(1)
- func() {
- if options.Mode == types.ASYNC {
- self.c.OnWorker(f)
- } else {
- f()
- }
- wg.Done()
- }()
+ if options.Mode == types.ASYNC {
+ self.c.OnWorker(f)
+ } else {
+ f()
+ }
}
if scopeSet.Includes(types.COMMITS) || scopeSet.Includes(types.BRANCHES) || scopeSet.Includes(types.REFLOG) || scopeSet.Includes(types.BISECT_INFO) {
@@ -143,8 +137,6 @@ func (self *RefreshHelper) Refresh(options types.RefreshOptions) error {
refresh(func() { _ = self.mergeConflictsHelper.RefreshMergeState() })
}
- wg.Wait()
-
self.refreshStatus()
if options.Then != nil {