Improve merge asserts
This commit is contained in:
1 parent
f485b729bc
commit
ed9ade05ea
1 file changed
+1
-2
+1
-2
@@ -145,6 +145,7 @@ func (es *Entries) add(hostname, containerid string, origin router.PeerName, add
|
|||||||
|
|
||||||
func (es *Entries) merge(incoming Entries) Entries {
|
func (es *Entries) merge(incoming Entries) Entries {
|
||||||
defer es.checkAndPanic().checkAndPanic()
|
defer es.checkAndPanic().checkAndPanic()
|
||||||
|
incoming.checkAndPanic()
|
||||||
|
|
||||||
newEntries := Entries{}
|
newEntries := Entries{}
|
||||||
i := 0
|
i := 0
|
||||||
@@ -233,8 +234,6 @@ type GossipData struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *GossipData) Merge(o router.GossipData) {
|
func (g *GossipData) Merge(o router.GossipData) {
|
||||||
checkAndPanic(CaseInsensitive(g.Entries))
|
|
||||||
defer func() { checkAndPanic(CaseInsensitive(g.Entries)) }()
|
|
||||||
other := o.(*GossipData)
|
other := o.(*GossipData)
|
||||||
g.Entries.merge(other.Entries)
|
g.Entries.merge(other.Entries)
|
||||||
if g.Timestamp < other.Timestamp {
|
if g.Timestamp < other.Timestamp {
|
||||||
|
|||||||
Reference in new issue
Block a user