Skip to content

Commit 2ec3015

Browse files
authored
Merge pull request #1292 from ogres/master
2 parents face055 + 2788573 commit 2ec3015

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Foundation/DateInterval.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ public struct DateInterval : ReferenceConvertible, Comparable, Hashable {
5252
///
5353
/// - precondition: `end >= start`
5454
public init(start: Date, end: Date) {
55-
if end < start {
56-
fatalError("Reverse intervals are not allowed")
57-
}
58-
55+
precondition(end >= start, "Reverse intervals are not allowed")
5956
self.start = start
6057
duration = end.timeIntervalSince(start)
6158
}

0 commit comments

Comments
 (0)