Use markdown.Config as pointer everywhere

* As value mutex was copied and therefore synchronization worked wrong
* It's pretty big structure with reference types, so copying create unnecessary
  pressure on GC

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
Alexander Morozov
2015-09-10 15:12:46 -07:00
parent 55de037035
commit da7b9a6bbc
6 changed files with 20 additions and 20 deletions

View File

@ -102,7 +102,7 @@ func generateStaticHTML(md Markdown, cfg *Config) error {
// Generate the static file
ctx := middleware.Context{Root: md.FileSys}
_, err = md.Process(*cfg, reqPath, body, ctx)
_, err = md.Process(cfg, reqPath, body, ctx)
if err != nil {
return err
}
@ -115,7 +115,7 @@ func generateStaticHTML(md Markdown, cfg *Config) error {
}
// computeDirHash computes an hash on static directory of c.
func computeDirHash(md Markdown, c Config) (string, error) {
func computeDirHash(md Markdown, c *Config) (string, error) {
dir := filepath.Join(md.Root, c.PathScope)
if _, err := os.Stat(dir); err != nil {
return "", err