Improve TotalWords counter func
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 17 Aug 2016 04:37:19 +0000 (06:37 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 14 Sep 2016 08:50:56 +0000 (10:50 +0200)
commit4abaec5c045e92ae5f8b3a2dc66606b080ef6ea5
treecf8c09108526475a9b445a9ba34656a9b17b9494
parentbcd434794a28ff75a6e6504c6c3bada554ba88ce
Improve TotalWords counter func

It is obviously more efficient when we do not care about the actual words.

```
BenchmarkTotalWords-4            100000         18795 ns/op           0 B/op           0 allocs/op
BenchmarkTotalWordsOld-4          30000         46751 ns/op        6400 B/op           1 allocs/op
```
helpers/content.go
helpers/content_test.go
hugolib/page.go