@@ -7,15 +7,15 @@ namespace Dijkstra.NET.Graph
7
7
{
8
8
public class Node < T , TEdgeCustom > : IPageRank , IDijkstra , INode < T , TEdgeCustom > where TEdgeCustom : IEquatable < TEdgeCustom >
9
9
{
10
+ public Edge < T , TEdgeCustom > [ ] Edges ;
10
11
private readonly HashSet < Node < T , TEdgeCustom > > _parents = new HashSet < Node < T , TEdgeCustom > > ( ) ;
11
12
private readonly HashSet < uint > _children = new HashSet < uint > ( ) ;
12
- private Edge < T , TEdgeCustom > [ ] _edges ;
13
13
14
14
internal Node ( uint key , T item , Graph < T , TEdgeCustom > graph )
15
15
{
16
16
Key = key ;
17
17
Item = item ;
18
- _edges = new Edge < T , TEdgeCustom > [ 5 ] ;
18
+ Edges = new Edge < T , TEdgeCustom > [ 5 ] ;
19
19
Graph = graph ;
20
20
}
21
21
@@ -46,7 +46,7 @@ public void EachEdge(Edge edge)
46
46
{
47
47
for ( int i = 0 ; i < EdgesCount ; i ++ )
48
48
{
49
- ref Edge < T , TEdgeCustom > e = ref _edges [ i ] ;
49
+ ref Edge < T , TEdgeCustom > e = ref Edges [ i ] ;
50
50
51
51
edge ( e . Node . Key , e . Cost ) ;
52
52
}
@@ -58,15 +58,15 @@ public void EachEdge(Edge edge)
58
58
/// <returns>TEdgeCustom</returns>
59
59
public TEdgeCustom GetFirstEdgeCustom ( int nodeEdgeKey )
60
60
{
61
- return _edges . First ( c => c . Node . Key == nodeEdgeKey ) . Item ;
61
+ return Edges . First ( c => c . Node . Key == nodeEdgeKey ) . Item ;
62
62
}
63
63
64
64
65
65
internal void AddEdge ( in Edge < T , TEdgeCustom > edge )
66
66
{
67
- if ( _edges . Length == EdgesCount )
67
+ if ( Edges . Length == EdgesCount )
68
68
{
69
- int newSize = _edges . Length ;
69
+ int newSize = Edges . Length ;
70
70
71
71
if ( EdgesCount < NodeConstants . MaxSize )
72
72
{
@@ -79,10 +79,10 @@ internal void AddEdge(in Edge<T, TEdgeCustom> edge)
79
79
newSize = bigSize < Int32 . MaxValue ? ( int ) bigSize : Int32 . MaxValue ;
80
80
}
81
81
82
- Array . Resize ( ref _edges , newSize ) ;
82
+ Array . Resize ( ref Edges , newSize ) ;
83
83
}
84
84
85
- _edges [ EdgesCount ] = edge ;
85
+ Edges [ EdgesCount ] = edge ;
86
86
EdgesCount ++ ;
87
87
_children . Add ( edge . Node . Key ) ;
88
88
}
0 commit comments