From 1d5fba6f6f208b5c30c71f46494d974ce1fcefe2 Mon Sep 17 00:00:00 2001
From: paulaan <weburnittv@gmail.com>
Date: Thu, 2 May 2019 17:37:23 +0700
Subject: [PATCH] [fanout] Codereview

---
 messaging/fanout.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/messaging/fanout.go b/messaging/fanout.go
index 83cf36e..d2c3304 100644
--- a/messaging/fanout.go
+++ b/messaging/fanout.go
@@ -30,8 +30,8 @@ func (p *Pipeline) Start() {
 			if expectationWorkers > MaxWorkers {
 				expectationWorkers = expectationWorkers % MaxWorkers
 			}
-			for _, c := range pipe.workers {
-				if expectationWorkers < int(c.index) {
+			for index, c := range pipe.workers {
+				if expectationWorkers < index {
 					break
 				}
 				select {