Skip to content

Commit

Permalink
move init out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxin9014 committed Aug 10, 2022
1 parent bf8e56c commit 6eb1758
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion executor/aggregate.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,12 @@ func (w *baseHashAggWorker) getPartialResult(sc *stmtctx.StatementContext, group
n := len(groupKey)
partialResults := make([][]aggfuncs.PartialResult, n)
allMemDelta := int64(0)
partialResultSize := w.getPartialResultSliceLenConsiderByteAlign()
for i := 0; i < n; i++ {
var ok bool
if partialResults[i], ok = mapper[string(groupKey[i])]; ok {
continue
}
partialResultSize := w.getPartialResultSliceLenConsiderByteAlign()
partialResults[i] = make([]aggfuncs.PartialResult, partialResultSize)
for j, af := range w.aggFuncs {
partialResult, memDelta := af.AllocPartialResult()
Expand Down

0 comments on commit 6eb1758

Please sign in to comment.