File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 4
4
@_implementationOnly import func CRT. floor
5
5
@_implementationOnly import func CRT. ceil
6
6
7
+ @inline ( __always)
8
+ private func __equals( _ lhs: Rect , _ rhs: Rect ) -> Bool {
9
+ return lhs. origin == rhs. origin && lhs. size == rhs. size
10
+ }
11
+
7
12
/// A structure that contains the location and dimensions of a rectangle.
8
13
public struct Rect {
9
14
// MARK - Creating Rectangle Values
@@ -219,22 +224,15 @@ public struct Rect {
219
224
220
225
/// Returns whether the rectangle is equal to the null rectangle.
221
226
public var isNull : Bool {
222
- return self . pureEqualityCheck ( . null)
223
- }
224
-
225
- @inline ( __always) private func pureEqualityCheck( _ rhs: Rect )
226
- -> Bool {
227
- return ( self . origin == rhs. origin) && ( self . size == rhs. size)
227
+ return __equals ( self , . null)
228
228
}
229
229
}
230
230
231
-
232
-
233
231
extension Rect : Equatable {
234
232
// MARK - Operator Functions
235
233
public static func == ( lhs: Rect , rhs: Rect ) -> Bool {
236
234
let lhs : Rect = lhs. standardized, rhs : Rect = rhs. standardized
237
- return lhs . pureEqualityCheck ( rhs)
235
+ return __equals ( lhs , rhs)
238
236
}
239
237
}
240
238
You can’t perform that action at this time.
0 commit comments