From 19e292268896c245c781e711ae3fff5ff5e127e5 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Mon, 5 Aug 2013 13:24:33 -0700 Subject: [PATCH] cmd/gc: get rid of redundant slice bound check. For normal slices a[i:j] we're generating 3 bounds checks: j<={len(string),cap(slice)}, j<=j (!), and i<=j. Somehow snuck in as part of the [i:j:k] implementation where the second check does something. Remove the second check when we don't need it. R=rsc, r CC=golang-dev https://golang.org/cl/12311046 --- src/cmd/gc/walk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c index 892d73bc6f..033b041f3c 100644 --- a/src/cmd/gc/walk.c +++ b/src/cmd/gc/walk.c @@ -2623,7 +2623,7 @@ sliceany(Node* n, NodeList **init) cb = n->right->right->right; } else { hb = n->right->right; - cb = hb; + cb = N; } bounded = n->etype; -- 2.48.1