absurlreplacer: remove superfluous code, take 2
authorbep <bjorn.erik.pedersen@gmail.com>
Sun, 3 May 2015 21:04:38 +0000 (23:04 +0200)
committerbep <bjorn.erik.pedersen@gmail.com>
Sun, 3 May 2015 21:04:37 +0000 (23:04 +0200)
 ```
benchmark                    old ns/op     new ns/op     delta
BenchmarkAbsURL              17946         17454         -2.74%
BenchmarkAbsURLSrcset        19236         18979         -1.34%
BenchmarkXMLAbsURLSrcset     19046         18688         -1.88%
BenchmarkXMLAbsURL           9561          9432          -1.35%

benchmark                    old allocs     new allocs     delta
BenchmarkAbsURL              24             24             +0.00%
BenchmarkAbsURLSrcset        29             29             +0.00%
BenchmarkXMLAbsURLSrcset     27             27             +0.00%
BenchmarkXMLAbsURL           12             12             +0.00%

benchmark                    old bytes     new bytes     delta
BenchmarkAbsURL              3139          3139          +0.00%
BenchmarkAbsURLSrcset        2374          2369          -0.21%
BenchmarkXMLAbsURLSrcset     2574          2572          -0.08%
BenchmarkXMLAbsURL           1871          1871          +0.00%

```

See #1059

transform/absurlreplacer.go

index caea5addac3643a30193ca6597c97c0820639dd6..b38dd9a98d5522f66312f435030a6c1b19c07718 100644 (file)
@@ -281,13 +281,10 @@ func newAbsURLReplacer(baseURL string) *absURLReplacer {
                htmlMatchers: []absURLMatcher{
                        {dqHTMLMatch, dqHTML, base},
                        {sqHTMLMatch, sqHTML, base},
-                       {dqHTMLMatch, dqHTML, base},
-                       {sqHTMLMatch, sqHTML, base}},
+               },
                xmlMatchers: []absURLMatcher{
                        {dqXMLMatch, dqXML, base},
                        {sqXMLMatch, sqXML, base},
-                       {dqXMLMatch, dqXML, base},
-                       {sqXMLMatch, sqXML, base},
                }}
 
 }