aboutsummaryrefslogtreecommitdiff
path: root/exec.go
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-05-26 14:40:44 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-05-26 14:40:44 +0900
commit882d8624ff72025b58dc097952bb962f717bb43d (patch)
tree21c48e41c47001af4edd0bcc43b4c609a90abc8e /exec.go
parent4220be3403b8eb7b352b4a9f10dbb374ecc227ed (diff)
downloadkati-882d8624ff72025b58dc097952bb962f717bb43d.tar.gz
Add a fast path for createRunners
Diffstat (limited to 'exec.go')
-rw-r--r--exec.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/exec.go b/exec.go
index 3e2980d..c9ed7f4 100644
--- a/exec.go
+++ b/exec.go
@@ -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,