Skip to content

Commit 5f5e3dc

Browse files
committed
Update as per suggestions
1 parent ad92fee commit 5f5e3dc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3387,12 +3387,10 @@ extension Driver {
33873387

33883388
// At most one *use* option allowed
33893389
if providedUse.count > 1 {
3390-
for i in 0..<(providedUse.count - 1) {
3391-
for j in (i + 1)..<providedUse.count {
3392-
diagnosticEngine.emit(
3393-
.error(Error.conflictingOptions(providedUse[i], providedUse[j])),
3394-
location: nil
3395-
)
3390+
for (i, left) in providedUse.enumerated() {
3391+
for (j, right) in providedUse.enumerated() {
3392+
guard i < j else { continue }
3393+
diagnosticEngine.emit(.error(Error.conflictingOptions(left, right)), location: nil)
33963394
}
33973395
}
33983396
}

0 commit comments

Comments
 (0)