mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
accelerate one task execution
This commit is contained in:
parent
dde06289bb
commit
eafe580be4
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user