Browse Source

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
Andrew Bursavich 11 years ago
parent
commit
84f8955a88
1 changed files with 1 additions and 1 deletions
  1. 1 1
      context/context.go

+ 1 - 1
context/context.go

@@ -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
 		}