mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
@@ -37,6 +37,7 @@ import (
|
||||
"github.com/gohugoio/hugo/hugolib/doctree"
|
||||
"github.com/gohugoio/hugo/hugolib/pagesfromdata"
|
||||
"github.com/gohugoio/hugo/identity"
|
||||
"github.com/gohugoio/hugo/lazy"
|
||||
"github.com/gohugoio/hugo/media"
|
||||
"github.com/gohugoio/hugo/output"
|
||||
"github.com/gohugoio/hugo/resources"
|
||||
@@ -109,6 +110,11 @@ type pageMap struct {
|
||||
cfg contentMapConfig
|
||||
}
|
||||
|
||||
// Invoked on rebuilds.
|
||||
func (m *pageMap) Reset() {
|
||||
m.pageReverseIndex.Reset()
|
||||
}
|
||||
|
||||
// pageTrees holds pages and resources in a tree structure for all sites/languages.
|
||||
// Each site gets its own tree set via the Shape method.
|
||||
type pageTrees struct {
|
||||
@@ -958,9 +964,7 @@ type contentTreeReverseIndex struct {
|
||||
}
|
||||
|
||||
func (c *contentTreeReverseIndex) Reset() {
|
||||
c.contentTreeReverseIndexMap = &contentTreeReverseIndexMap{
|
||||
m: make(map[any]contentNodeI),
|
||||
}
|
||||
c.init.ResetWithLock().Unlock()
|
||||
}
|
||||
|
||||
func (c *contentTreeReverseIndex) Get(key any) contentNodeI {
|
||||
@@ -972,7 +976,7 @@ func (c *contentTreeReverseIndex) Get(key any) contentNodeI {
|
||||
}
|
||||
|
||||
type contentTreeReverseIndexMap struct {
|
||||
init sync.Once
|
||||
init lazy.OnceMore
|
||||
m map[any]contentNodeI
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user