Optimize for the common case in Blackfriday config

This commit is contained in:
bep 2015-01-31 23:45:38 +01:00
parent c50780930e
commit b984ec96bc

View file

@ -199,14 +199,17 @@ func (p *Page) getRenderingConfig() *helpers.Blackfriday {
pageParam := p.GetParam("blackfriday")
siteParam := viper.GetStringMap("blackfriday")
combinedParam := make(map[string]interface{})
for k, v := range siteParam {
combinedParam[k] = v
}
combinedParam := siteParam
if pageParam != nil {
combinedParam = make(map[string]interface{})
for k, v := range siteParam {
combinedParam[k] = v
}
pageConfig := cast.ToStringMap(pageParam)
for key, value := range pageConfig {
combinedParam[key] = value
}