1
- public struct AppInfo : Equatable {
1
+ public struct AppInfo {
2
2
let appId : String
3
3
let appName : String
4
4
let appVersion : String
@@ -24,44 +24,4 @@ public struct AppInfo: Equatable {
24
24
self . appLanguage = appLanguage
25
25
self . customAttributes = customAttributes
26
26
}
27
-
28
- public static func == ( lhs: AppInfo , rhs: AppInfo ) -> Bool {
29
- return lhs. appId == rhs. appId &&
30
- lhs. appName == rhs. appName &&
31
- lhs. appVersion == rhs. appVersion &&
32
- lhs. platform == rhs. platform &&
33
- lhs. environment == rhs. environment &&
34
- lhs. appLanguage == rhs. appLanguage &&
35
- areDictionariesEqual ( lhs. customAttributes, rhs. customAttributes)
36
- }
37
-
38
- private static func areDictionariesEqual( _ dict1: [ String : Any ] ? , _ dict2: [ String : Any ] ? ) -> Bool {
39
- guard let dict1 = dict1, let dict2 = dict2 else {
40
- return dict1 == nil && dict2 == nil
41
- }
42
-
43
- if dict1. count != dict2. count {
44
- return false
45
- }
46
-
47
- for (key, value1) in dict1 {
48
- guard let value2 = dict2 [ key] else {
49
- return false
50
- }
51
-
52
- if !areEqual( value1, value2) {
53
- return false
54
- }
55
- }
56
-
57
- return true
58
- }
59
-
60
- private static func areEqual( _ value1: Any , _ value2: Any ) -> Bool {
61
- if let value1 = value1 as? Equatable , let value2 = value2 as? Equatable {
62
- return value1 == value2
63
- }
64
-
65
- return false
66
- }
67
27
}
0 commit comments