Update the code logic for latestNode in tree.go (#2897)

This commit is contained in:
Zhu Xi
2021-10-23 11:58:57 +08:00
committed by GitHub
parent 34ae7777ca
commit 3fe928994b
5 changed files with 120 additions and 52 deletions

View File

@ -55,8 +55,9 @@ type Context struct {
index int8
fullPath string
engine *Engine
params *Params
engine *Engine
params *Params
skippedNodes *[]skippedNode
// This mutex protect Keys map
mu sync.RWMutex
@ -99,6 +100,7 @@ func (c *Context) reset() {
c.queryCache = nil
c.formCache = nil
*c.params = (*c.params)[:0]
*c.skippedNodes = (*c.skippedNodes)[:0]
}
// Copy returns a copy of the current context that can be safely used outside the request's scope.