aboutsummaryrefslogtreecommitdiff
path: root/src/regexp
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2019-09-02 14:17:23 +0200
committerDaniel Martí <mvdan@mvdan.cc>2019-09-02 12:57:37 +0000
commit03ac39ce5e6af4c4bca58b54d5b160a154b7aa0e (patch)
treee40846ac626b4be09b8ff5bf6e3ffab9cb3e36bc /src/regexp
parentd5fe73393c40c7b4070aa73903671c8d1f23f2c2 (diff)
downloadgo-03ac39ce5e6af4c4bca58b54d5b160a154b7aa0e.tar.gz
go-03ac39ce5e6af4c4bca58b54d5b160a154b7aa0e.zip
std: remove unused bits of code all over the place
Some were never used, and some haven't been used for years. One exception is net/http's readerAndCloser, which was only used in a test. Move it to a test file. While at it, remove a check in regexp that could never fire; the field is an uint32, so it can never be negative. Change-Id: Ia2200f6afa106bae4034045ea8233b452f38747b Reviewed-on: https://go-review.googlesource.com/c/go/+/192621 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/regexp')
-rw-r--r--src/regexp/backtrack.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/regexp/backtrack.go b/src/regexp/backtrack.go
index 9fb7d1e493..41ae59bcaa 100644
--- a/src/regexp/backtrack.go
+++ b/src/regexp/backtrack.go
@@ -247,7 +247,7 @@ func (re *Regexp) tryBacktrack(b *bitState, i input, pc uint32, pos int) bool {
b.cap[inst.Arg] = pos
continue
} else {
- if 0 <= inst.Arg && inst.Arg < uint32(len(b.cap)) {
+ if inst.Arg < uint32(len(b.cap)) {
// Capture pos to register, but save old value.
b.push(re, pc, b.cap[inst.Arg], true) // come back when we're done.
b.cap[inst.Arg] = pos