cancelOp was cancelling the first op in the queue

This commit is contained in:
Bryan Boreham authored and Marc Carré committed 2017-03-21 11:38:35 +00:00
1 parent ef7571f1ef
commit 1af5699948
1 file changed
+2 -2
+2 -2
View File
@@ -210,9 +210,9 @@ func (alloc *Allocator) doOperation(op operation, ops *[]operation) {
// already succeeded. If it is on the queue, we call
// cancel on it, allowing callers waiting for the resultChans
// to unblock.
func (alloc *Allocator) cancelOp(op operation, ops *[]operation) {
func (alloc *Allocator) cancelOp(opToCancel operation, ops *[]operation) {
for i, op := range *ops {
if op == op {
if op == opToCancel {
*ops = append((*ops)[:i], (*ops)[i+1:]...)
op.Cancel()
break