summaryrefslogtreecommitdiffstats
path: root/macosx/NSArray+HBAdditions.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2020-09-12 11:22:33 +0200
committerDamiano Galassi <[email protected]>2020-09-12 11:22:33 +0200
commit03e0c447fbc6d0ba946370b923bfb543528ef71c (patch)
treee0f7b157bce007bf54989e0646add3c8189e07d0 /macosx/NSArray+HBAdditions.m
parent7980989a63d63750e86cedbc0018dc6e1f0481aa (diff)
MacGui: improve queue contextual menu items validation.
Diffstat (limited to 'macosx/NSArray+HBAdditions.m')
-rw-r--r--macosx/NSArray+HBAdditions.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/macosx/NSArray+HBAdditions.m b/macosx/NSArray+HBAdditions.m
index f24417632..1bea369a8 100644
--- a/macosx/NSArray+HBAdditions.m
+++ b/macosx/NSArray+HBAdditions.m
@@ -20,6 +20,18 @@
return YES;
}
+- (BOOL)containsWhere:(BOOL (^)(id object))block
+{
+ for (id object in self)
+ {
+ if (block(object) == YES)
+ {
+ return YES;
+ }
+ }
+ return NO;
+}
+
- (NSArray *)filteredArrayUsingBlock:(BOOL (^)(id object))block
{
NSMutableArray *filteredArray = [NSMutableArray array];