From 825add0120c2e153cb4f0482788bc54a4a51dafa Mon Sep 17 00:00:00 2001 From: Ian Preston Date: Sat, 28 Oct 2017 12:55:08 +0100 Subject: [PATCH] improve style License: MIT Signed-off-by: Ian Preston --- merkledag/utils/diffenum.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/merkledag/utils/diffenum.go b/merkledag/utils/diffenum.go index 2066fa338d7..c186f22d9b8 100644 --- a/merkledag/utils/diffenum.go +++ b/merkledag/utils/diffenum.go @@ -72,14 +72,15 @@ func getLinkDiff(a, b node.Node) []diffpair { inb[l.Cid.KeyString()] = l } for _, l := range a.Links() { - ina[l.Cid.KeyString()] = l - if inb[l.Cid.KeyString()] == nil { + var key = l.Cid.KeyString() + ina[key] = l + if inb[key] == nil { aonly = append(aonly, l.Cid) } } var out []diffpair - var aindex = 0 + var aindex int for _, l := range b.Links() { if ina[l.Cid.KeyString()] != nil {