diff --git a/graph/multi/directed.go b/graph/multi/directed.go index 9f9f00b2..2799f7e8 100644 --- a/graph/multi/directed.go +++ b/graph/multi/directed.go @@ -248,7 +248,7 @@ func (g *DirectedGraph) SetLine(l graph.Line) { switch { case g.from[fid] == nil: - g.from[fid] = map[int64]map[int64]graph.Line{tid: map[int64]graph.Line{lid: l}} + g.from[fid] = map[int64]map[int64]graph.Line{tid: {lid: l}} case g.from[fid][tid] == nil: g.from[fid][tid] = map[int64]graph.Line{lid: l} default: @@ -256,7 +256,7 @@ func (g *DirectedGraph) SetLine(l graph.Line) { } switch { case g.to[tid] == nil: - g.to[tid] = map[int64]map[int64]graph.Line{fid: map[int64]graph.Line{lid: l}} + g.to[tid] = map[int64]map[int64]graph.Line{fid: {lid: l}} case g.to[tid][fid] == nil: g.to[tid][fid] = map[int64]graph.Line{lid: l} default: diff --git a/graph/multi/undirected.go b/graph/multi/undirected.go index b735c106..2033b513 100644 --- a/graph/multi/undirected.go +++ b/graph/multi/undirected.go @@ -249,7 +249,7 @@ func (g *UndirectedGraph) SetLine(l graph.Line) { switch { case g.lines[fid] == nil: - g.lines[fid] = map[int64]map[int64]graph.Line{tid: map[int64]graph.Line{lid: l}} + g.lines[fid] = map[int64]map[int64]graph.Line{tid: {lid: l}} case g.lines[fid][tid] == nil: g.lines[fid][tid] = map[int64]graph.Line{lid: l} default: @@ -257,7 +257,7 @@ func (g *UndirectedGraph) SetLine(l graph.Line) { } switch { case g.lines[tid] == nil: - g.lines[tid] = map[int64]map[int64]graph.Line{fid: map[int64]graph.Line{lid: l}} + g.lines[tid] = map[int64]map[int64]graph.Line{fid: {lid: l}} case g.lines[tid][fid] == nil: g.lines[tid][fid] = map[int64]graph.Line{lid: l} default: diff --git a/graph/multi/weighted_directed.go b/graph/multi/weighted_directed.go index 7b4ad30e..329d9730 100644 --- a/graph/multi/weighted_directed.go +++ b/graph/multi/weighted_directed.go @@ -257,7 +257,7 @@ func (g *WeightedDirectedGraph) SetWeightedLine(l graph.WeightedLine) { switch { case g.from[fid] == nil: - g.from[fid] = map[int64]map[int64]graph.WeightedLine{tid: map[int64]graph.WeightedLine{lid: l}} + g.from[fid] = map[int64]map[int64]graph.WeightedLine{tid: {lid: l}} case g.from[fid][tid] == nil: g.from[fid][tid] = map[int64]graph.WeightedLine{lid: l} default: @@ -265,7 +265,7 @@ func (g *WeightedDirectedGraph) SetWeightedLine(l graph.WeightedLine) { } switch { case g.to[tid] == nil: - g.to[tid] = map[int64]map[int64]graph.WeightedLine{fid: map[int64]graph.WeightedLine{lid: l}} + g.to[tid] = map[int64]map[int64]graph.WeightedLine{fid: {lid: l}} case g.to[tid][fid] == nil: g.to[tid][fid] = map[int64]graph.WeightedLine{lid: l} default: diff --git a/graph/multi/weighted_undirected.go b/graph/multi/weighted_undirected.go index 32178143..94f069cb 100644 --- a/graph/multi/weighted_undirected.go +++ b/graph/multi/weighted_undirected.go @@ -259,7 +259,7 @@ func (g *WeightedUndirectedGraph) SetWeightedLine(l graph.WeightedLine) { switch { case g.lines[fid] == nil: - g.lines[fid] = map[int64]map[int64]graph.WeightedLine{tid: map[int64]graph.WeightedLine{lid: l}} + g.lines[fid] = map[int64]map[int64]graph.WeightedLine{tid: {lid: l}} case g.lines[fid][tid] == nil: g.lines[fid][tid] = map[int64]graph.WeightedLine{lid: l} default: @@ -267,7 +267,7 @@ func (g *WeightedUndirectedGraph) SetWeightedLine(l graph.WeightedLine) { } switch { case g.lines[tid] == nil: - g.lines[tid] = map[int64]map[int64]graph.WeightedLine{fid: map[int64]graph.WeightedLine{lid: l}} + g.lines[tid] = map[int64]map[int64]graph.WeightedLine{fid: {lid: l}} case g.lines[tid][fid] == nil: g.lines[tid][fid] = map[int64]graph.WeightedLine{lid: l} default: diff --git a/spatial/kdtree/points.go b/spatial/kdtree/points.go index 3785a4b9..25706492 100644 --- a/spatial/kdtree/points.go +++ b/spatial/kdtree/points.go @@ -19,7 +19,7 @@ type Point []float64 func (p Point) Compare(c Comparable, d Dim) float64 { q := c.(Point); return p[d] - q[d] } // Dims returns the number of dimensions described by the receiver. -func (p Point) Dims() int { return len(p) } +func (p Point) Dims() int { return len(p) } // Distance returns the squared Euclidean distance between c and the receiver. The // concrete type of c must be Point.