mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 03:41:34 +00:00
neotest: preallocate coverage blocks list
And always use pointers for coverage block processing, dereference is excessive in this context. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
49f2e1dc64
commit
c747bb8ff7
1 changed files with 4 additions and 4 deletions
|
@ -154,7 +154,7 @@ func writeCoverageReport(w io.Writer) {
|
|||
}
|
||||
}
|
||||
|
||||
func processCover() map[documentName][]coverBlock {
|
||||
func processCover() map[documentName][]*coverBlock {
|
||||
documents := make(map[documentName]struct{})
|
||||
for _, scriptRawCoverage := range rawCoverage {
|
||||
for _, documentName := range scriptRawCoverage.debugInfo.Documents {
|
||||
|
@ -162,7 +162,7 @@ func processCover() map[documentName][]coverBlock {
|
|||
}
|
||||
}
|
||||
|
||||
cover := make(map[documentName][]coverBlock)
|
||||
cover := make(map[documentName][]*coverBlock)
|
||||
|
||||
for documentName := range documents {
|
||||
mappedBlocks := make(map[int]*coverBlock)
|
||||
|
@ -197,9 +197,9 @@ func processCover() map[documentName][]coverBlock {
|
|||
}
|
||||
}
|
||||
|
||||
var blocks []coverBlock
|
||||
var blocks = make([]*coverBlock, 0, len(mappedBlocks))
|
||||
for _, b := range mappedBlocks {
|
||||
blocks = append(blocks, *b)
|
||||
blocks = append(blocks, b)
|
||||
}
|
||||
cover[documentName] = blocks
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue