File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -105,18 +105,18 @@ func (h *hasher) hashFullNodeChildren(n *fullNode) *fullNode {
105105 var children [17 ]node
106106 if h .parallel {
107107 var wg sync.WaitGroup
108- wg .Add (16 )
109108 for i := 0 ; i < 16 ; i ++ {
110- go func (i int ) {
111- hasher := newHasher (false )
112- if child := n .Children [i ]; child != nil {
109+ if child := n .Children [i ]; child != nil {
110+ wg .Add (1 )
111+ go func (i int ) {
112+ hasher := newHasher (false )
113113 children [i ] = hasher .hash (child , false )
114- } else {
115- children [ i ] = nilValueNode
116- }
117- returnHasherToPool ( hasher )
118- wg . Done ()
119- }( i )
114+ returnHasherToPool ( hasher )
115+ wg . Done ()
116+ }( i )
117+ } else {
118+ children [ i ] = nilValueNode
119+ }
120120 }
121121 wg .Wait ()
122122 } else {
You can’t perform that action at this time.
0 commit comments