Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 3e24e3c

Browse files
committed
removed vertice from name
1 parent b7424c3 commit 3e24e3c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Analysis/Core/Impl/DependencyResolution/PathResolverSnapshot.Edge.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ private readonly struct Edge {
3838
// will be stored as list of pairs: (2, c), (0, i), (1, y)
3939
//
4040
// To provide immutability, it must be changed only by calling List<T>.Add
41-
private readonly ImmutableArray<(int indexInParentVertices, Node node)> _pathFromRoot;
41+
private readonly ImmutableArray<(int nodeIndexInParent, Node node)> _pathFromRoot;
4242

4343
// indicates which entry in the _pathFromRoot correspond to this edge.
4444
private readonly int _indexInPath;
4545

4646
public Node ParentNode => IsFirst ? default : _pathFromRoot[_indexInPath - 1].node;
47-
public int nodeIndexInParent => _pathFromRoot[_indexInPath].indexInParentVertices;
47+
public int NodeIndexInParent => _pathFromRoot[_indexInPath].nodeIndexInParent;
4848
public Node Node => _pathFromRoot[_indexInPath].node;
4949
public Edge Previous => IsFirst ? default : new Edge(_pathFromRoot, _indexInPath - 1);
5050
public Edge Next => IsLast ? default : new Edge(_pathFromRoot, _indexInPath + 1);
@@ -107,7 +107,7 @@ public override int GetHashCode() {
107107
private string DebuggerDisplay {
108108
get {
109109
var start = _indexInPath > 0 ? _pathFromRoot[_indexInPath - 1].node.Name : "null";
110-
var endIndex = _pathFromRoot[_indexInPath].indexInParentVertices.ToString();
110+
var endIndex = _pathFromRoot[_indexInPath].nodeIndexInParent.ToString();
111111
var end = _pathFromRoot[_indexInPath].node.Name;
112112
return $"[{start}]-{endIndex}-[{end}]";
113113
}

src/Analysis/Core/Impl/DependencyResolution/PathResolverSnapshot.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ public PathResolverSnapshot AddModulePath(in string modulePath, long moduleFileS
469469

470470
var newEnd = CreateNewNodes(lastEdge, unmatchedPathSpan, moduleFileSize, out fullModuleName);
471471
var newRoot = RewriteTreeSpine(lastEdge, newEnd);
472-
return ImmutableReplaceRoot(newRoot, lastEdge.FirstEdge.nodeIndexInParent);
472+
return ImmutableReplaceRoot(newRoot, lastEdge.FirstEdge.NodeIndexInParent);
473473
}
474474

475475
public PathResolverSnapshot RemoveModulePath(in string modulePath) {
@@ -480,20 +480,20 @@ public PathResolverSnapshot RemoveModulePath(in string modulePath) {
480480

481481
var moduleNode = lastEdge.Node;
482482
var moduleParent = lastEdge.ParentNode;
483-
var moduleIndex = lastEdge.nodeIndexInParent;
483+
var moduleIndex = lastEdge.NodeIndexInParent;
484484

485485
var newParent = moduleNode.Children.Count > 0
486486
? moduleParent.ReplaceChildAt(moduleNode.ToPackage(), moduleIndex) // preserve node as package
487487
: moduleParent.RemoveChildAt(moduleIndex);
488488

489489
if (lastEdge.IsNonRooted) {
490-
var directoryIndex = lastEdge.Previous.nodeIndexInParent;
490+
var directoryIndex = lastEdge.Previous.NodeIndexInParent;
491491
return ReplaceNonRooted(_nonRooted.ReplaceChildAt(newParent, directoryIndex));
492492
}
493493

494494
lastEdge = lastEdge.Previous;
495495
var newRoot = RewriteTreeSpine(lastEdge, newParent);
496-
return ImmutableReplaceRoot(newRoot, lastEdge.FirstEdge.nodeIndexInParent);
496+
return ImmutableReplaceRoot(newRoot, lastEdge.FirstEdge.NodeIndexInParent);
497497
}
498498

499499
private bool MatchNodePathInNonRooted(string normalizedPath, out Edge lastEdge, out StringSpan unmatchedPathSpan) {
@@ -612,7 +612,7 @@ private Node AddToNonRooted(in Edge lastEdge, in StringSpan unmatchedPathSpan, i
612612
return _nonRooted.AddChild(Node.CreatePackage(directory, directory, moduleNode));
613613
}
614614

615-
var directoryIndex = lastEdge.nodeIndexInParent;
615+
var directoryIndex = lastEdge.NodeIndexInParent;
616616
var directoryNode = lastEdge.Node.AddChild(moduleNode);
617617
return _nonRooted.ReplaceChildAt(directoryNode, directoryIndex);
618618
}
@@ -713,7 +713,7 @@ private static void AppendName(StringBuilder builder, string name)
713713

714714
private static Node RewriteTreeSpine(Edge lastEdge, Node newNode) {
715715
while (lastEdge.ParentNode != null) {
716-
var newParentNode = lastEdge.ParentNode.ReplaceChildAt(newNode, lastEdge.nodeIndexInParent);
716+
var newParentNode = lastEdge.ParentNode.ReplaceChildAt(newNode, lastEdge.NodeIndexInParent);
717717
lastEdge = lastEdge.Previous;
718718
newNode = newParentNode;
719719
}

0 commit comments

Comments
 (0)