File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ extension NSOrderedSet {
210
210
}
211
211
212
212
open func isSubset( of other: NSOrderedSet ) -> Bool {
213
+ if count > other. count {
214
+ return false
215
+ }
216
+
213
217
for item in self {
214
218
if !other. contains ( item) {
215
219
return false
@@ -219,6 +223,10 @@ extension NSOrderedSet {
219
223
}
220
224
221
225
open func isSubset( of set: Set < AnyHashable > ) -> Bool {
226
+ if count > set. count {
227
+ return false
228
+ }
229
+
222
230
for item in self {
223
231
if !set. contains ( item as! AnyHashable ) {
224
232
return false
Original file line number Diff line number Diff line change @@ -208,6 +208,10 @@ extension NSSet {
208
208
}
209
209
210
210
open func isSubset( of otherSet: Set < AnyHashable > ) -> Bool {
211
+ if count > otherSet. count {
212
+ return false
213
+ }
214
+
211
215
// `true` if we don't contain any object that `otherSet` doesn't contain.
212
216
for item in self {
213
217
if !otherSet. contains ( item as! AnyHashable ) {
You can’t perform that action at this time.
0 commit comments