Skip to content

Commit

Permalink
fix: update change log and adjust variable name for edgeMetric
Browse files Browse the repository at this point in the history
issue: #282
  • Loading branch information
CodeBear801 committed Apr 28, 2020
1 parent a4c429d commit 961ff36
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG-FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changes from v10.2.0
- Feature:
- ADDED **HTTP API** `annotation/ways` in OSRM route response after `osrm-ranking` process(retrieve `annotation/ways` from `annotation/nodes`) [#296](https://github.com/Telenav/osrm-backend/pull/296)
- CHANGED for internal refactoring, moved `unidbpatch` and `mapsource` packages into `integration/util` folder [#300](https://github.com/Telenav/osrm-backend/pull/300)
- CHANGED for internal refactoring, refactor staiongraph to isolate algorithm, data structure and topological [#302]
- CHANGED for internal refactoring, refactor stationgraph to isolate algorithm, data structure and topological [#302](https://github.com/Telenav/osrm-backend/pull/302)
- CHANGED for internal refactoring, change `edgeIDAndData` to `edge` and replace internal location definition with nav.Location [#307](https://github.com/Telenav/osrm-backend/pull/307)
- Bugfix:
- CHANGED `osrm-ranking` parsing of OSRM route response to compatible with `string` array `annotation/nodes` [#296](https://github.com/Telenav/osrm-backend/pull/296)
- Performance:
Expand Down
4 changes: 2 additions & 2 deletions integration/service/oasis/stationgraph/edge.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ type edgeMetric struct {
}

type edge struct {
edgeId edgeID
edgeData *edgeMetric
edgeId edgeID
edgeMetric *edgeMetric
}
2 changes: 1 addition & 1 deletion integration/service/oasis/stationgraph/graph_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ func (graph *mockGraph) Edge(from, to nodeID) *edgeMetric {
if ok {
for _, edge := range edges {
if edge.edgeId.toNodeID == to {
return edge.edgeData
return edge.edgeMetric
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions integration/service/oasis/stationgraph/node_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type edgeID2EdgeData map[edgeID]*edgeMetric
type nodeGraph struct {
nodeContainer *nodeContainer
adjacentList nodeID2AdjacentNodes
edgeData edgeID2EdgeData
edgeMetric edgeID2EdgeData
startNodeID nodeID
endNodeID nodeID
strategy chargingstrategy.Strategy
Expand All @@ -25,7 +25,7 @@ func NewNodeGraph(strategy chargingstrategy.Strategy, query connectivitymap.Quer
return &nodeGraph{
nodeContainer: newNodeContainer(),
adjacentList: make(nodeID2AdjacentNodes),
edgeData: make(edgeID2EdgeData),
edgeMetric: make(edgeID2EdgeData),
startNodeID: invalidNodeID,
endNodeID: invalidNodeID,
strategy: strategy,
Expand Down Expand Up @@ -63,7 +63,7 @@ func (g *nodeGraph) Edge(from, to nodeID) *edgeMetric {
toNodeID: to,
}

return g.edgeData[edgeID]
return g.edgeMetric[edgeID]
}

// SetStart generates start node for the nodeGraph
Expand Down Expand Up @@ -115,7 +115,7 @@ func (g *nodeGraph) createLogicalNodes(from nodeID, toStationID string, toLocati
endNodeID := g.EndNodeID()
if toStationID == g.StationID(endNodeID) {
results = append(results, g.Node(endNodeID))
g.edgeData[edgeID{from, endNodeID}] = &edgeMetric{
g.edgeMetric[edgeID{from, endNodeID}] = &edgeMetric{
distance: distance,
duration: duration}
return results
Expand All @@ -127,7 +127,7 @@ func (g *nodeGraph) createLogicalNodes(from nodeID, toStationID string, toLocati
Lon: toLocation.Lon})
results = append(results, n)

g.edgeData[edgeID{from, n.id}] = &edgeMetric{
g.edgeMetric[edgeID{from, n.id}] = &edgeMetric{
distance: distance,
duration: duration}
}
Expand Down

0 comments on commit 961ff36

Please sign in to comment.