context: make parentCancelCtx iterative

It seems like it was meant to be this way. There was already a for loop, but then it made a recursive call instead.

LGTM=sameer
R=golang-codereviews, sameer
CC=golang-codereviews
https://golang.org/cl/113540044
This commit is contained in:
Andrew Bursavich
2014-08-11 16:57:02 -04:00
committed by Sameer Ajmani
parent 9c40a72a07
commit 84f8955a88

View File

@@ -254,7 +254,7 @@ func parentCancelCtx(parent Context) (*cancelCtx, bool) {
case *timerCtx:
return &c.cancelCtx, true
case *valueCtx:
return parentCancelCtx(c.Context)
parent = c.Context
default:
return nil, false
}