From: Russ Cox Date: Thu, 27 Mar 2014 18:05:14 +0000 (-0400) Subject: regexp/syntax: remove InstLast X-Git-Tag: go1.3beta1~253 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ef3c0e7e61ba1a670d69144b5ad8318166490ae8;p=gostls13.git regexp/syntax: remove InstLast This was added by the one-pass CL (post Go 1.2) so it can still be removed. Removing because surely there will be new operations added later, and we can't change the constant value once we define it, so "last" is a bad concept to expose. Nothing uses it. LGTM=bradfitz R=golang-codereviews, bradfitz CC=golang-codereviews https://golang.org/cl/81160043 --- diff --git a/src/pkg/regexp/syntax/prog.go b/src/pkg/regexp/syntax/prog.go index 5a0bc7f9b4..c4563ae752 100644 --- a/src/pkg/regexp/syntax/prog.go +++ b/src/pkg/regexp/syntax/prog.go @@ -36,7 +36,6 @@ const ( InstRune1 InstRuneAny InstRuneAnyNotNL - InstLast ) var instOpNames = []string{ @@ -54,7 +53,7 @@ var instOpNames = []string{ } func (i InstOp) String() string { - if i >= InstLast { + if uint(i) >= uint(len(instOpNames)) { return "" } return instOpNames[i]