Move apply before cache put

It just looks better.

See #1293
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
}