Skip to content

Commit

Permalink
Merge pull request Snapchat#165 from jb-gcx/remove-unused-parameters
Browse files Browse the repository at this point in the history
Remove unused parameters in support lib
  • Loading branch information
li-feng-sc authored Mar 28, 2024
2 parents e76b268 + ceb77de commit 9fcbec8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions support-lib/objc/DJOutcome.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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<id, id>*)fromResult:(id)result {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion support-lib/objc/DataRef_objc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class DataRefObjc : public DataRef::Impl {
auto buf = reinterpret_cast<const uint8_t*>(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<DataObj*>(info);
delete p;
Expand Down

0 comments on commit 9fcbec8

Please sign in to comment.