From 957ae48b0d7e2f6d0c51b78bbeff72fc9dd44b2e Mon Sep 17 00:00:00 2001 From: Silvan Jegen Date: Fri, 23 Oct 2015 19:53:23 +0200 Subject: Remove unneeded check The first worker in the slice will always be the first one to be done. There is no need to check whether the slice is empty either. --- gwic.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gwic.go b/gwic.go index ace3fca..fdefdad 100644 --- a/gwic.go +++ b/gwic.go @@ -58,10 +58,7 @@ func feedworkers(wlist []*work, w string) []*work { for _, wc := range wlist { if wc.left == 0 { wc.finish() - // TODO: remove the right one? - if len(wlist) >= 1 { - ret = wlist[1:] - } + ret = wlist[1:] } else { wc.c <- w wc.left -= 1 -- cgit v1.2.3