Skip to content

Commit 44ece85

Browse files
authored
Merge pull request #3187 from artemcm/FixRangePrecondition
[NFC] Avoid use of unavailable range 'contains' method
2 parents 61afe79 + fd92ceb commit 44ece85

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

Sources/SwiftWarningControl/WarningControlRegions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private class WarningControlRegionNode {
254254

255255
/// Add a child region that is directly nested within this region
256256
func addChild(_ node: WarningControlRegionNode) {
257-
precondition(range.contains(node.range))
257+
precondition(range.lowerBound <= node.range.lowerBound && node.range.upperBound <= range.upperBound)
258258
children.append(node)
259259
children.sort()
260260
}

Tests/SwiftWarningControlTest/WarningControlTests.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,6 @@ private func assertWarningGroupControl(
386386
groupInheritanceTree: groupInheritanceTree
387387
)
388388

389-
print(warningControlRegions.debugDescription)
390-
391389
let groupControl = token.warningGroupControl(
392390
for: diagnosticGroupID,
393391
globalControls: globalControls,

0 commit comments

Comments
 (0)