Skip to content

Commit aa45c60

Browse files
committed
Tighten up some assertions
1 parent 1854942 commit aa45c60

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/SwiftDiagnostics/DiagnosticsFormatter.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ extension Sequence where Element == Range<Int> {
2929
}
3030

3131
// If the ranges overlap, expand the prior range.
32+
assert(priorRange.lowerBound <= range.lowerBound)
3233
if priorRange.overlaps(range) {
33-
let lower = Swift.min(priorRange.lowerBound, range.lowerBound)
34+
let lower = priorRange.lowerBound
3435
let upper = Swift.max(priorRange.upperBound, range.upperBound)
3536
prior = lower..<upper
3637
continue

0 commit comments

Comments
 (0)