Skip to content

Commit 6c9ae98

Browse files
committed
s/EachAdjacentTo/AdjacentTo/
1 parent ca15700 commit 6c9ae98

11 files changed

+18
-18
lines changed

graph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ type AdjacencyEnumerator interface {
269269
// Calls the provided step function once with each vertex adjacent to the
270270
// the provided vertex. In a digraph, this includes both successor
271271
// and predecessor vertices.
272-
EachAdjacentTo(start Vertex, adjacentVertexStep VertexStep)
272+
AdjacentTo(start Vertex, adjacentVertexStep VertexStep)
273273
}
274274

275275
// A VertexMembershipChecker can indicate the presence of a vertex.

graph/al/data.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (g *dataDirected) IncidentTo(v Vertex, f EdgeStep) {
130130
}
131131

132132
// Enumerates the vertices adjacent to the provided vertex.
133-
func (g *dataDirected) EachAdjacentTo(start Vertex, f VertexStep) {
133+
func (g *dataDirected) AdjacentTo(start Vertex, f VertexStep) {
134134
g.mu.RLock()
135135
defer g.mu.RUnlock()
136136

@@ -439,7 +439,7 @@ func (g *dataUndirected) IncidentTo(v Vertex, f EdgeStep) {
439439
}
440440

441441
// Enumerates the vertices adjacent to the provided vertex.
442-
func (g *dataUndirected) EachAdjacentTo(vertex Vertex, f VertexStep) {
442+
func (g *dataUndirected) AdjacentTo(vertex Vertex, f VertexStep) {
443443
g.mu.RLock()
444444
defer g.mu.RUnlock()
445445

graph/al/directed.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (g *mutableDirected) IncidentTo(v Vertex, f EdgeStep) {
8181
}
8282

8383
// Enumerates the vertices adjacent to the provided vertex.
84-
func (g *mutableDirected) EachAdjacentTo(start Vertex, f VertexStep) {
84+
func (g *mutableDirected) AdjacentTo(start Vertex, f VertexStep) {
8585
g.mu.RLock()
8686
defer g.mu.RUnlock()
8787

@@ -315,7 +315,7 @@ func (g *immutableDirected) IncidentTo(v Vertex, f EdgeStep) {
315315
}
316316

317317
// Enumerates the vertices adjacent to the provided vertex.
318-
func (g *immutableDirected) EachAdjacentTo(start Vertex, f VertexStep) {
318+
func (g *immutableDirected) AdjacentTo(start Vertex, f VertexStep) {
319319
g.IncidentTo(start, func(e Edge) bool {
320320
u, v := e.Both()
321321
if u == start {

graph/al/labeled.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ func (g *labeledDirected) IncidentTo(v Vertex, f EdgeStep) {
160160
}
161161

162162
// Enumerates the vertices adjacent to the provided vertex.
163-
func (g *labeledDirected) EachAdjacentTo(start Vertex, f VertexStep) {
163+
func (g *labeledDirected) AdjacentTo(start Vertex, f VertexStep) {
164164
g.mu.RLock()
165165
defer g.mu.RUnlock()
166166

@@ -438,7 +438,7 @@ func (g *labeledUndirected) IncidentTo(v Vertex, f EdgeStep) {
438438
}
439439

440440
// Enumerates the vertices adjacent to the provided vertex.
441-
func (g *labeledUndirected) EachAdjacentTo(vertex Vertex, f VertexStep) {
441+
func (g *labeledUndirected) AdjacentTo(vertex Vertex, f VertexStep) {
442442
g.mu.RLock()
443443
defer g.mu.RUnlock()
444444

graph/al/undirected.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (g *mutableUndirected) IncidentTo(v Vertex, f EdgeStep) {
5959
}
6060

6161
// Enumerates the vertices adjacent to the provided vertex.
62-
func (g *mutableUndirected) EachAdjacentTo(vertex Vertex, f VertexStep) {
62+
func (g *mutableUndirected) AdjacentTo(vertex Vertex, f VertexStep) {
6363
g.mu.RLock()
6464
defer g.mu.RUnlock()
6565

graph/al/weighted.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func (g *weightedDirected) IncidentTo(v Vertex, f EdgeStep) {
130130
}
131131

132132
// Enumerates the vertices adjacent to the provided vertex.
133-
func (g *weightedDirected) EachAdjacentTo(start Vertex, f VertexStep) {
133+
func (g *weightedDirected) AdjacentTo(start Vertex, f VertexStep) {
134134
g.mu.RLock()
135135
defer g.mu.RUnlock()
136136

@@ -438,7 +438,7 @@ func (g *weightedUndirected) IncidentTo(v Vertex, f EdgeStep) {
438438
}
439439

440440
// Enumerates the vertices adjacent to the provided vertex.
441-
func (g *weightedUndirected) EachAdjacentTo(vertex Vertex, f VertexStep) {
441+
func (g *weightedUndirected) AdjacentTo(vertex Vertex, f VertexStep) {
442442
g.mu.RLock()
443443
defer g.mu.RUnlock()
444444

null.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (g nullGraph) ArcsFrom(Vertex, ArcStep) {}
2626
func (g nullGraph) EachPredecessorOf(Vertex, VertexStep) {}
2727
func (g nullGraph) ArcsTo(Vertex, ArcStep) {}
2828
func (g nullGraph) EachSuccessorOf(Vertex, VertexStep) {}
29-
func (g nullGraph) EachAdjacentTo(start Vertex, f VertexStep) {}
29+
func (g nullGraph) AdjacentTo(start Vertex, f VertexStep) {}
3030

3131
func (g nullGraph) HasVertex(v Vertex) bool {
3232
return false

null_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (s NullGraphSuite) TestEnumerators(c *C) {
2525
return
2626
})
2727

28-
NullGraph.EachAdjacentTo("foo", func(v Vertex) (terminate bool) {
28+
NullGraph.AdjacentTo("foo", func(v Vertex) (terminate bool) {
2929
c.Error("The NullGraph should be empty of edges and vertices.")
3030
return
3131
})

spec/literal.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (g GraphLiteralFixture) EachSuccessorOf(v Vertex, f VertexStep) {
170170
}
171171
}
172172

173-
func (g GraphLiteralFixture) EachAdjacentTo(v Vertex, f VertexStep) {
173+
func (g GraphLiteralFixture) AdjacentTo(v Vertex, f VertexStep) {
174174
switch v {
175175
case "foo":
176176
f("bar")

spec/suite_graph.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ func (s *GraphSuite) TestEdgesTermination(c *C) {
8585
c.Assert(hit, Equals, 1)
8686
}
8787

88-
func (s *GraphSuite) TestEachAdjacentTo(c *C) {
88+
func (s *GraphSuite) TestAdjacentTo(c *C) {
8989
g := s.Factory(GraphFixtures["2e3v"])
9090

9191
vset := set.NewNonTS()
9292
var hit int
93-
g.EachAdjacentTo("bar", func(adj Vertex) (terminate bool) {
93+
g.AdjacentTo("bar", func(adj Vertex) (terminate bool) {
9494
hit++
9595
vset.Add(adj)
9696
return
@@ -102,11 +102,11 @@ func (s *GraphSuite) TestEachAdjacentTo(c *C) {
102102
c.Assert(hit, Equals, 2)
103103
}
104104

105-
func (s *GraphSuite) TestEachAdjacentToTermination(c *C) {
105+
func (s *GraphSuite) TestAdjacentToTermination(c *C) {
106106
g := s.Factory(GraphFixtures["3e4v"])
107107

108108
var hit int
109-
g.EachAdjacentTo("foo", func(adjacent Vertex) bool {
109+
g.AdjacentTo("foo", func(adjacent Vertex) bool {
110110
hit++
111111
return true
112112
})

util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func CollectVerticesAdjacentTo(v Vertex, g AdjacencyEnumerator) (vertices []Vert
7474
vertices = make([]Vertex, 0, 8)
7575
}
7676

77-
g.EachAdjacentTo(v, func(v Vertex) (terminate bool) {
77+
g.AdjacentTo(v, func(v Vertex) (terminate bool) {
7878
vertices = append(vertices, v)
7979
return
8080
})

0 commit comments

Comments
 (0)