Skip to content

Commit fcc986d

Browse files
committed
Drop label from SyntaxInTree initializer
1 parent 4896fd1 commit fcc986d

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/SyntaxIdentifier.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@
1515
public struct SyntaxIndexInTree: Comparable, Hashable {
1616
let indexInTree: UInt32
1717

18-
static var zero: SyntaxIndexInTree = SyntaxIndexInTree(indexInTree: 0)
18+
static var zero: SyntaxIndexInTree = SyntaxIndexInTree(0)
1919

2020
/// Assuming that this index points to the start of ``Raw``, so that it points
2121
/// to the next sibling of ``Raw``.
2222
func advancedBy(_ raw: RawSyntax?) -> SyntaxIndexInTree {
2323
let newIndexInTree = self.indexInTree + UInt32(truncatingIfNeeded: raw?.totalNodes ?? 0)
24-
return .init(indexInTree: newIndexInTree)
24+
return .init(newIndexInTree)
2525
}
2626

2727
/// Assuming that this index points to the next sibling of ``Raw``, reverse it
2828
/// so that it points to the start of ``Raw``.
2929
func reversedBy(_ raw: RawSyntax?) -> SyntaxIndexInTree {
3030
let newIndexInTree = self.indexInTree - UInt32(truncatingIfNeeded: raw?.totalNodes ?? 0)
31-
return .init(indexInTree: newIndexInTree)
31+
return .init(newIndexInTree)
3232
}
3333

3434
func advancedToFirstChild() -> SyntaxIndexInTree {
3535
let newIndexInTree = self.indexInTree + 1
36-
return .init(indexInTree: newIndexInTree)
36+
return .init(newIndexInTree)
3737
}
3838

39-
init(indexInTree: UInt32) {
39+
init(_ indexInTree: UInt32) {
4040
self.indexInTree = indexInTree
4141
}
4242

0 commit comments

Comments
 (0)