Skip to content

Commit 663c747

Browse files
committed
[CoreGraphics] Move == operators into their respective types.
1 parent 5e31b5b commit 663c747

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

stdlib/public/SDK/CoreGraphics/CoreGraphics.swift

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ import Darwin
1717
// CGAffineTransform
1818
//===----------------------------------------------------------------------===//
1919

20-
extension CGAffineTransform: Equatable {}
21-
public func ==(lhs: CGAffineTransform, rhs: CGAffineTransform) -> Bool {
22-
return lhs.__equalTo(rhs)
20+
extension CGAffineTransform: Equatable {
21+
public static func ==(lhs: CGAffineTransform,
22+
rhs: CGAffineTransform) -> Bool {
23+
return lhs.__equalTo(rhs)
24+
}
2325
}
2426

2527
//===----------------------------------------------------------------------===//
@@ -228,10 +230,11 @@ extension CGPoint : CustomDebugStringConvertible {
228230
}
229231
}
230232

231-
extension CGPoint : Equatable {}
232-
@_transparent // @fragile
233-
public func == (lhs: CGPoint, rhs: CGPoint) -> Bool {
234-
return lhs.x == rhs.x && lhs.y == rhs.y
233+
extension CGPoint : Equatable {
234+
@_transparent // @fragile
235+
public static func == (lhs: CGPoint, rhs: CGPoint) -> Bool {
236+
return lhs.x == rhs.x && lhs.y == rhs.y
237+
}
235238
}
236239

237240
public extension CGSize {
@@ -279,10 +282,11 @@ extension CGSize : CustomDebugStringConvertible {
279282
}
280283
}
281284

282-
extension CGSize : Equatable {}
283-
@_transparent // @fragile
284-
public func == (lhs: CGSize, rhs: CGSize) -> Bool {
285-
return lhs.width == rhs.width && lhs.height == rhs.height
285+
extension CGSize : Equatable {
286+
@_transparent // @fragile
287+
public static func == (lhs: CGSize, rhs: CGSize) -> Bool {
288+
return lhs.width == rhs.width && lhs.height == rhs.height
289+
}
286290
}
287291

288292
public extension CGVector {
@@ -302,10 +306,11 @@ public extension CGVector {
302306
}
303307
}
304308

305-
extension CGVector : Equatable {}
306-
@_transparent // @fragile
307-
public func == (lhs: CGVector, rhs: CGVector) -> Bool {
308-
return lhs.dx == rhs.dx && lhs.dy == rhs.dy
309+
extension CGVector : Equatable {
310+
@_transparent // @fragile
311+
public static func == (lhs: CGVector, rhs: CGVector) -> Bool {
312+
return lhs.dx == rhs.dx && lhs.dy == rhs.dy
313+
}
309314
}
310315

311316
extension CGVector : CustomDebugStringConvertible {
@@ -380,10 +385,11 @@ extension CGRect : CustomDebugStringConvertible {
380385
}
381386
}
382387

383-
extension CGRect : Equatable {}
384-
@_transparent // @fragile
385-
public func == (lhs: CGRect, rhs: CGRect) -> Bool {
386-
return lhs.equalTo(rhs)
388+
extension CGRect : Equatable {
389+
@_transparent // @fragile
390+
public static func == (lhs: CGRect, rhs: CGRect) -> Bool {
391+
return lhs.equalTo(rhs)
392+
}
387393
}
388394

389395
extension CGAffineTransform {

0 commit comments

Comments
 (0)