]> Cypherpunks repositories - gostls13.git/commit
strings: implement a faster byte->string Replacer
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 3 Oct 2011 22:19:04 +0000 (15:19 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 3 Oct 2011 22:19:04 +0000 (15:19 -0700)
commitbba7396fbd4c3245dbedd3cc2a1fb25137331ebb
tree042d2580b79df727ae9f01e6de5cda1e093f1b9e
parente419535f2ae5c8aef1f64cdb207049c8712ffb48
strings: implement a faster byte->string Replacer

This implements a replacer for when all old strings are single
bytes, but new values are not.

BenchmarkHTMLEscapeNew   1000000   1090 ns/op
BenchmarkHTMLEscapeOld   1000000   2049 ns/op

R=rsc
CC=golang-dev
https://golang.org/cl/5176043
src/pkg/http/header.go
src/pkg/http/server.go
src/pkg/mime/multipart/writer.go
src/pkg/strings/replace.go
src/pkg/strings/replace_test.go