1
0
Fork 0
mirror of https://github.com/gohugoio/hugo.git synced 2025-04-30 22:39:52 +00:00

Move apply before cache put

It just looks better.

See 
This commit is contained in:
Bjørn Erik Pedersen 2015-07-24 00:28:21 +02:00
parent 47e65c4acd
commit 28020f866b

View file

@ -59,16 +59,16 @@ func (c *pageCache) get(key string, p Pages, apply func(p Pages)) (Pages, bool)
pagesCopy := append(Pages(nil), p...)
if apply != nil {
apply(pagesCopy)
}
if v, ok := c.m[key]; ok {
c.m[key] = append(v, [2]Pages{p, pagesCopy})
} else {
c.m[key] = [][2]Pages{[2]Pages{p, pagesCopy}}
}
if apply != nil {
apply(pagesCopy)
}
return pagesCopy, false
}