Build the draw fence's fold with the fence, deleting its lazy accessor
This commit is contained in:
@@ -239,7 +239,7 @@ func checkNodeFences(s nodeScope) error {
|
||||
if err := s(heldCheck); err != nil {
|
||||
return err
|
||||
}
|
||||
fence := &drawFence{}
|
||||
fence := &drawFence{fold: newReadFold()}
|
||||
refs := false
|
||||
if err := s(func(path string, n node) error {
|
||||
if t, ok := n.(*template); ok && len(t.link.refs) > 0 {
|
||||
|
||||
+3
-10
@@ -14,13 +14,6 @@ type drawFence struct {
|
||||
fold *readFold
|
||||
}
|
||||
|
||||
func (f *drawFence) reads() *readFold {
|
||||
if f.fold == nil {
|
||||
f.fold = newReadFold()
|
||||
}
|
||||
return f.fold
|
||||
}
|
||||
|
||||
// checkDrawGroup refuses a draw group that splits nothing: one whose render reads every reference
|
||||
// path inside a repeat or a nested draw group, which draw apart from it whatever it names.
|
||||
func (f *drawFence) checkDrawGroup(path string, n node) error {
|
||||
@@ -28,7 +21,7 @@ func (f *drawFence) checkDrawGroup(path string, n node) error {
|
||||
if !ok || t.drawGroup == "" {
|
||||
return nil
|
||||
}
|
||||
for _, r := range f.reads().rootReads(t) {
|
||||
for _, r := range f.fold.rootReads(t) {
|
||||
if r.at.group == "" && r.draws() {
|
||||
return nil
|
||||
}
|
||||
@@ -41,7 +34,7 @@ func (f *drawFence) checkDraws(path string, n node) error {
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
reads := f.reads().rootReads(t)
|
||||
reads := f.fold.rootReads(t)
|
||||
if !anyDraws(reads) {
|
||||
return nil
|
||||
}
|
||||
@@ -59,7 +52,7 @@ func (f *drawFence) checkRecordDraws(path string, n node) error {
|
||||
if !ok || !t.isRecord {
|
||||
return nil
|
||||
}
|
||||
reads := f.reads().columnReads(t, sortedNames(t.fields))
|
||||
reads := f.fold.columnReads(t, sortedNames(t.fields))
|
||||
if !anyDraws(reads) {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user