Skip to content

Commit a7ad642

Browse files
committed
Remove unnecessary variables in toCompressed
1 parent 844bb30 commit a7ad642

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

trie/ctrie/ctrie.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,10 +493,8 @@ func toContracted(cn *cNode, lev uint) *mainNode {
493493

494494
// toCompressed compacts the C-node as a performance optimization.
495495
func toCompressed(cn *cNode, lev uint) *mainNode {
496-
bmp := cn.bmp
497-
arr := cn.array
498-
tmpArray := make([]branch, len(arr))
499-
for i, sub := range arr {
496+
tmpArray := make([]branch, len(cn.array))
497+
for i, sub := range cn.array {
500498
switch sub.(type) {
501499
case *iNode:
502500
inode := sub.(*iNode)
@@ -510,7 +508,7 @@ func toCompressed(cn *cNode, lev uint) *mainNode {
510508
}
511509
}
512510

513-
return toContracted(&cNode{bmp: bmp, array: tmpArray}, lev)
511+
return toContracted(&cNode{bmp: cn.bmp, array: tmpArray}, lev)
514512
}
515513

516514
func entomb(m *sNode) *mainNode {

0 commit comments

Comments
 (0)