Skip to content

Commit dd37387

Browse files
committed
Drop label from SyntaxInTree initializer
1 parent 3ee9d14 commit dd37387

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/SwiftSyntax/SyntaxChildren.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ struct RawSyntaxChildren: BidirectionalCollection {
222222
let offset = startIndex.offset + UInt32(parent.totalLength.utf8Length)
223223
let indexInParent = startIndex.indexInParent + UInt32(parentLayoutView.children.count)
224224
let indexInTree = startIndex.indexInTree.indexInTree + UInt32(parent.totalNodes) - 1
225-
let syntaxIndexInTree = SyntaxIndexInTree(indexInTree: indexInTree)
225+
let syntaxIndexInTree = SyntaxIndexInTree(indexInTree)
226226
let materialized = SyntaxChildrenIndex(
227227
offset: offset,
228228
indexInParent: indexInParent,

Sources/SwiftSyntax/SyntaxData.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,28 @@ struct AbsoluteSyntaxInfo {
6262
public struct SyntaxIndexInTree: Comparable, Hashable {
6363
let indexInTree: UInt32
6464

65-
static var zero: SyntaxIndexInTree = SyntaxIndexInTree(indexInTree: 0)
65+
static var zero: SyntaxIndexInTree = SyntaxIndexInTree(0)
6666

6767
/// Assuming that this index points to the start of ``Raw``, so that it points
6868
/// to the next sibling of ``Raw``.
6969
func advancedBy(_ raw: RawSyntax?) -> SyntaxIndexInTree {
7070
let newIndexInTree = self.indexInTree + UInt32(truncatingIfNeeded: raw?.totalNodes ?? 0)
71-
return .init(indexInTree: newIndexInTree)
71+
return .init(newIndexInTree)
7272
}
7373

7474
/// Assuming that this index points to the next sibling of ``Raw``, reverse it
7575
/// so that it points to the start of ``Raw``.
7676
func reversedBy(_ raw: RawSyntax?) -> SyntaxIndexInTree {
7777
let newIndexInTree = self.indexInTree - UInt32(truncatingIfNeeded: raw?.totalNodes ?? 0)
78-
return .init(indexInTree: newIndexInTree)
78+
return .init(newIndexInTree)
7979
}
8080

8181
func advancedToFirstChild() -> SyntaxIndexInTree {
8282
let newIndexInTree = self.indexInTree + 1
83-
return .init(indexInTree: newIndexInTree)
83+
return .init(newIndexInTree)
8484
}
8585

86-
init(indexInTree: UInt32) {
86+
init(_ indexInTree: UInt32) {
8787
self.indexInTree = indexInTree
8888
}
8989

0 commit comments

Comments
 (0)