Do not use defer for unlocking in Scratch
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 24 Mar 2016 14:33:25 +0000 (15:33 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 24 Mar 2016 15:03:31 +0000 (16:03 +0100)
commitc846b051f3ecbf42d31bc992567946e8569d3881
treeda2caa69b89291aed0f12e3da08d7a6795aed77f
parentfa1a9653e5147731657269ba3d71124f1fda79c7
Do not use defer for unlocking in Scratch

It is a fairly costly operation:

```
benchmark                 old ns/op     new ns/op     delta
BenchmarkScratchGet-4     109           31.6          -71.01%

benchmark                 old allocs     new allocs     delta
BenchmarkScratchGet-4     0              0              +0.00%

benchmark                 old bytes     new bytes     delta
BenchmarkScratchGet-4     0             0             +0.00%
´´´
hugolib/scratch.go