From 503cb046e4731ad0077a737c2c9b93f5d50e645d Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 28 Aug 2018 17:18:10 -0600 Subject: [PATCH] remove unused FunctionalUtil code --- Signal/src/util/FunctionalUtil.h | 11 +--------- Signal/src/util/FunctionalUtil.m | 24 ++-------------------- SignalServiceKit/src/Util/FunctionalUtil.h | 11 +--------- SignalServiceKit/src/Util/FunctionalUtil.m | 22 +------------------- 4 files changed, 5 insertions(+), 63 deletions(-) diff --git a/Signal/src/util/FunctionalUtil.h b/Signal/src/util/FunctionalUtil.h index 02fcdeabe..021997a8f 100644 --- a/Signal/src/util/FunctionalUtil.h +++ b/Signal/src/util/FunctionalUtil.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // @interface NSArray (FunctionalUtil) @@ -19,15 +19,6 @@ /// Returns an array of all the results of passing items from this array through the given projection function. - (NSArray *)filter:(int (^)(id item))predicate; -/// Returns the sum of the doubles in this array of doubles. -- (double)sumDouble; - -/// Returns the sum of the unsigned integers in this array of unsigned integers. -- (NSUInteger)sumNSUInteger; - -/// Returns the sum of the integers in this array of integers. -- (NSInteger)sumNSInteger; - - (NSDictionary *)keyedBy:(id (^)(id))keySelector; - (NSDictionary *)groupBy:(id (^)(id value))keySelector; diff --git a/Signal/src/util/FunctionalUtil.m b/Signal/src/util/FunctionalUtil.m index 148f3c522..7a433b443 100644 --- a/Signal/src/util/FunctionalUtil.m +++ b/Signal/src/util/FunctionalUtil.m @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "FunctionalUtil.h" @@ -52,27 +52,7 @@ } return r; } -- (double)sumDouble { - double s = 0.0; - for (NSNumber *e in self) { - s += [e doubleValue]; - } - return s; -} -- (NSUInteger)sumNSUInteger { - NSUInteger s = 0; - for (NSNumber *e in self) { - s += [e unsignedIntegerValue]; - } - return s; -} -- (NSInteger)sumNSInteger { - NSInteger s = 0; - for (NSNumber *e in self) { - s += [e integerValue]; - } - return s; -} + - (NSDictionary *)keyedBy:(id (^)(id value))keySelector { OWSAssertDebug(keySelector != nil); diff --git a/SignalServiceKit/src/Util/FunctionalUtil.h b/SignalServiceKit/src/Util/FunctionalUtil.h index 02fcdeabe..021997a8f 100644 --- a/SignalServiceKit/src/Util/FunctionalUtil.h +++ b/SignalServiceKit/src/Util/FunctionalUtil.h @@ -1,5 +1,5 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // @interface NSArray (FunctionalUtil) @@ -19,15 +19,6 @@ /// Returns an array of all the results of passing items from this array through the given projection function. - (NSArray *)filter:(int (^)(id item))predicate; -/// Returns the sum of the doubles in this array of doubles. -- (double)sumDouble; - -/// Returns the sum of the unsigned integers in this array of unsigned integers. -- (NSUInteger)sumNSUInteger; - -/// Returns the sum of the integers in this array of integers. -- (NSInteger)sumNSInteger; - - (NSDictionary *)keyedBy:(id (^)(id))keySelector; - (NSDictionary *)groupBy:(id (^)(id value))keySelector; diff --git a/SignalServiceKit/src/Util/FunctionalUtil.m b/SignalServiceKit/src/Util/FunctionalUtil.m index a16fad521..a33279b79 100644 --- a/SignalServiceKit/src/Util/FunctionalUtil.m +++ b/SignalServiceKit/src/Util/FunctionalUtil.m @@ -75,27 +75,7 @@ } return r; } -- (double)sumDouble { - double s = 0.0; - for (NSNumber *e in self) { - s += [e doubleValue]; - } - return s; -} -- (NSUInteger)sumNSUInteger { - NSUInteger s = 0; - for (NSNumber *e in self) { - s += [e unsignedIntegerValue]; - } - return s; -} -- (NSInteger)sumNSInteger { - NSInteger s = 0; - for (NSNumber *e in self) { - s += [e integerValue]; - } - return s; -} + - (NSDictionary *)keyedBy:(id (^)(id value))keySelector { tskit_require(keySelector != nil);