Remove macro mutex as it's no longer needed
This commit is contained in:
parent
2a87e4781c
commit
ee4aa95dc3
@ -30,17 +30,13 @@ func (mt macroTag) Run(tc *TagContext, block, args []ast.Node) error {
|
||||
}
|
||||
|
||||
if len(block) == 0 {
|
||||
tc.t.macroMtx.Lock()
|
||||
macro, ok := tc.t.macros[name]
|
||||
if !ok {
|
||||
return ErrNoSuchMacro
|
||||
}
|
||||
tc.t.macroMtx.Unlock()
|
||||
return tc.Execute(macro, nil)
|
||||
} else {
|
||||
tc.t.macroMtx.Lock()
|
||||
tc.t.macros[name] = block
|
||||
tc.t.macroMtx.Unlock()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
2
parse.go
2
parse.go
@ -26,7 +26,6 @@ import (
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"go.elara.ws/salix/ast"
|
||||
"go.elara.ws/salix/parser"
|
||||
@ -57,7 +56,6 @@ func (n *Namespace) ParseWithName(name string, r io.Reader) (Template, error) {
|
||||
ast: astVal.([]ast.Node),
|
||||
tags: map[string]Tag{},
|
||||
vars: map[string]reflect.Value{},
|
||||
macroMtx: &sync.Mutex{},
|
||||
}
|
||||
|
||||
performWhitespaceMutations(t.ast)
|
||||
|
Loading…
Reference in New Issue
Block a user