diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-11-06 22:46:19 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:18 +0800 |
commit | 8f0b6a060586beb8f5eb4002cbe632cea1a093a6 (patch) | |
tree | c98631dae535ca20ab769e41a78f8688bf931924 /vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go | |
parent | 32dcd528f9152d6fe3e32f76adb1ea3c595910de (diff) | |
download | go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.tar go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.tar.gz go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.tar.bz2 go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.tar.lz go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.tar.xz go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.tar.zst go-tangerine-8f0b6a060586beb8f5eb4002cbe632cea1a093a6.zip |
vendor: sync to latest core
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go index 3222b3c2f..89dfef3fd 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go @@ -100,6 +100,9 @@ func (ns *NodeSet) Clone() *NodeSet { // GetSubSet returns the subset of given target. func (ns *NodeSet) GetSubSet( size int, target SubSetTarget) map[NodeID]struct{} { + if size == 0 { + return make(map[NodeID]struct{}) + } h := rankHeap{} idx := 0 for nID := range ns.IDs { |