diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-05-26 14:40:44 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-05-26 14:40:44 +0900 |
commit | 882d8624ff72025b58dc097952bb962f717bb43d (patch) | |
tree | 21c48e41c47001af4edd0bcc43b4c609a90abc8e /exec.go | |
parent | 4220be3403b8eb7b352b4a9f10dbb374ecc227ed (diff) | |
download | kati-882d8624ff72025b58dc097952bb962f717bb43d.tar.gz |
Add a fast path for createRunners
Diffstat (limited to 'exec.go')
-rw-r--r-- | exec.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -241,6 +241,11 @@ func (ex *Executor) Exec(roots []*DepNode) error { } func (ex *Executor) createRunners(n *DepNode, avoidIO bool) ([]runner, bool) { + var runners []runner + if len(n.Cmds) == 0 { + return runners, false + } + var restores []func() defer func() { for i := len(restores) - 1; i >= 0; i-- { @@ -262,7 +267,6 @@ func (ex *Executor) createRunners(n *DepNode, avoidIO bool) ([]runner, bool) { ev.avoidIO = avoidIO ev.filename = n.Filename ev.lineno = n.Lineno - var runners []runner Log("Building: %s cmds:%q", n.Output, n.Cmds) r := runner{ output: n.Output, |