File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ public func beginWith(_ startingElement: Any) -> Predicate<NMBOrderedCollection>
17
17
return Predicate . simple ( " begin with < \( startingElement) > " ) { actualExpression in
18
18
guard let collection = try actualExpression. evaluate ( ) else { return . fail }
19
19
guard collection. count > 0 else { return . doesNotMatch }
20
- #if os(Linux)
20
+ #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
21
+ let collectionValue = collection. object ( at: 0 ) as AnyObject
22
+ #else
21
23
guard let collectionValue = collection. object ( at: 0 ) as? NSObject else {
22
24
return . fail
23
25
}
24
- #else
25
- let collectionValue = collection. object ( at: 0 ) as AnyObject
26
26
#endif
27
27
return PredicateStatus ( bool: collectionValue. isEqual ( startingElement) )
28
28
}
Original file line number Diff line number Diff line change @@ -25,12 +25,12 @@ public func endWith(_ endingElement: Any) -> Predicate<NMBOrderedCollection> {
25
25
guard let collection = try actualExpression. evaluate ( ) else { return . fail }
26
26
27
27
guard collection. count > 0 else { return PredicateStatus ( bool: false ) }
28
- #if os(Linux)
28
+ #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
29
+ let collectionValue = collection. object ( at: collection. count - 1 ) as AnyObject
30
+ #else
29
31
guard let collectionValue = collection. object ( at: collection. count - 1 ) as? NSObject else {
30
32
return . fail
31
33
}
32
- #else
33
- let collectionValue = collection. object ( at: collection. count - 1 ) as AnyObject
34
34
#endif
35
35
36
36
return PredicateStatus ( bool: collectionValue. isEqual ( endingElement) )
You can’t perform that action at this time.
0 commit comments