From ceb77deed44908531efa2195900219902948d0a9 Mon Sep 17 00:00:00 2001 From: Jan Buenker Date: Thu, 14 Mar 2024 15:58:26 +0100 Subject: [PATCH] Remove unused parameters in support lib --- support-lib/objc/DJOutcome.mm | 10 +++++----- support-lib/objc/DataRef_objc.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/support-lib/objc/DJOutcome.mm b/support-lib/objc/DJOutcome.mm index c73d716e..81a724c9 100644 --- a/support-lib/objc/DJOutcome.mm +++ b/support-lib/objc/DJOutcome.mm @@ -23,12 +23,12 @@ @implementation DJOutcome { } -(instancetype)initWithResult:(id)result { if (self = [super init]) { - self->_accessor = ^(HANDLER resultHandler, HANDLER errorHandler) {return resultHandler(result);};} + self->_accessor = ^(HANDLER resultHandler, HANDLER) {return resultHandler(result);};} return self; } -(instancetype)initWithError:(id)error { if (self = [super init]) { - self->_accessor = ^(HANDLER resultHandler, HANDLER errorHandler) {return errorHandler(error);};} + self->_accessor = ^(HANDLER, HANDLER errorHandler) {return errorHandler(error);};} return self; } +(DJOutcome*)fromResult:(id)result { @@ -42,14 +42,14 @@ -(id)matchResult:(HANDLER) resultHandler Error:(HANDLER) errorHandler { } -(id)result { return _accessor(^(id result){ return result; }, - ^(id error) { return (id)nil; }); + ^(id) { return (id)nil; }); } -(id)resultOr:(id)defaultResult { return _accessor(^(id result){ return result; }, - ^(id error) { return defaultResult; }); + ^(id) { return defaultResult; }); } -(id)error { - return _accessor(^(id result){ return (id)nil; }, + return _accessor(^(id){ return (id)nil; }, ^(id error) { return error; }); } - (NSString *)description { diff --git a/support-lib/objc/DataRef_objc.cpp b/support-lib/objc/DataRef_objc.cpp index e8d59649..8a0c09da 100644 --- a/support-lib/objc/DataRef_objc.cpp +++ b/support-lib/objc/DataRef_objc.cpp @@ -107,7 +107,7 @@ class DataRefObjc : public DataRef::Impl { auto buf = reinterpret_cast(p->data()); auto len = p->size(); context.info = p; - context.deallocate = [](void* ptr, void* info) { + context.deallocate = [](void*, void* info) { // delete the wrapped object auto* p = reinterpret_cast(info); delete p;