absurlreplacer: write replacements directly to the byte buffer
authorbep <bjorn.erik.pedersen@gmail.com>
Tue, 10 Mar 2015 17:44:32 +0000 (18:44 +0100)
committerbep <bjorn.erik.pedersen@gmail.com>
Tue, 10 Mar 2015 17:50:22 +0000 (18:50 +0100)
commitc641ffea3af2ab16c6449574ea865f2ef10a448e
tree154bf9b207b11f4c8a1aa399144aa53eebc9d813
parent3ba279c2e5cdb4cbed300c0054b68c334590b7bf
absurlreplacer: write replacements directly to the byte buffer

The extra step isn't needed and this makes the code simpler.

And slightly faster:

benchmark              old ns/op     new ns/op     delta
BenchmarkAbsUrl        19987         17498         -12.45%
BenchmarkXmlAbsUrl     10606         9503          -10.40%

benchmark              old allocs     new allocs     delta
BenchmarkAbsUrl        28             24             -14.29%
BenchmarkXmlAbsUrl     14             12             -14.29%

benchmark              old bytes     new bytes     delta
BenchmarkAbsUrl        3512          3297          -6.12%
BenchmarkXmlAbsUrl     2059          1963          -4.66%
transform/absurlreplacer.go