Skip to content

Commit

Permalink
util: pre-alloc memory for decoding rows (pingcap#22508)
Browse files Browse the repository at this point in the history
Signed-off-by: Shuaipeng Yu <[email protected]>
  • Loading branch information
jackysp authored Jan 25, 2021
1 parent f3688eb commit 905e9af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/rowDecoder/decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ func (rd *RowDecoder) DecodeAndEvalRowWithMap(ctx sessionctx.Context, handle kv.
}
rd.mutRow.SetValue(colInfo.Offset, val.GetValue())
}
keys := make([]int, 0)
ids := make(map[int]int)
keys := make([]int, 0, len(rd.colMap))
ids := make(map[int]int, len(rd.colMap))
for k, col := range rd.colMap {
keys = append(keys, col.Col.Offset)
ids[col.Col.Offset] = int(k)
Expand Down

0 comments on commit 905e9af

Please sign in to comment.