From eafe580be4adab578c194bcad2be62935ddcfff8 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Sun, 15 Jul 2018 16:04:02 +0200 Subject: [PATCH] accelerate one task execution --- common/task/task.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/task/task.go b/common/task/task.go index e1640eac7..f79e5610a 100644 --- a/common/task/task.go +++ b/common/task/task.go @@ -20,6 +20,11 @@ func (c *executionContext) executeTask() error { return nil } + // Reuse current goroutine if we only have one task to run. + if len(c.tasks) == 1 && c.ctx == nil { + return c.tasks[0]() + } + ctx := context.Background() if c.ctx != nil {