Skip to content

Commit

Permalink
Merge pull request #143 from iosphere/fix/unusedVariables
Browse files Browse the repository at this point in the history
Fix unread and unused variables
  • Loading branch information
Christoph Krey committed May 23, 2016
2 parents d8a670e + 4077a6d commit c19ac06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions MQTTClient/MQTTClient/MQTTSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ - (void)checkTxFlows {
}

- (void)decoder:(MQTTDecoder*)sender handleEvent:(MQTTDecoderEvent)eventCode error:(NSError *)error {
NSArray *events = @[
__unused NSArray *events = @[
@"MQTTDecoderEventProtocolError",
@"MQTTDecoderEventConnectionClosed",
@"MQTTDecoderEventConnectionError"
Expand Down Expand Up @@ -696,7 +696,6 @@ - (void)handlePublish:(MQTTMessage*)msg {
NSRange range = NSMakeRange(2 + topicLength, [data length] - topicLength - 2);
data = [data subdataWithRange:range];
if ([msg qos] == 0) {
BOOL processed = true;
if ([self.delegate respondsToSelector:@selector(newMessage:data:onTopic:qos:retained:mid:)]) {
[self.delegate newMessage:self
data:data
Expand All @@ -706,12 +705,12 @@ - (void)handlePublish:(MQTTMessage*)msg {
mid:0];
}
if ([self.delegate respondsToSelector:@selector(newMessageWithFeedback:data:onTopic:qos:retained:mid:)]) {
processed = [self.delegate newMessageWithFeedback:self
data:data
onTopic:topic
qos:msg.qos
retained:msg.retainFlag
mid:0];
[self.delegate newMessageWithFeedback:self
data:data
onTopic:topic
qos:msg.qos
retained:msg.retainFlag
mid:0];
}
if (self.messageHandler) {
self.messageHandler(data, topic);
Expand Down
2 changes: 1 addition & 1 deletion MQTTClient/MQTTClient/MQTTSessionManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ - (void)disconnect
- (void)handleEvent:(MQTTSession *)session event:(MQTTSessionEvent)eventCode error:(NSError *)error
{
#ifdef DEBUG
const NSDictionary *events = @{
__unused const NSDictionary *events = @{
@(MQTTSessionEventConnected): @"connected",
@(MQTTSessionEventConnectionRefused): @"connection refused",
@(MQTTSessionEventConnectionClosed): @"connection closed",
Expand Down

0 comments on commit c19ac06

Please sign in to comment.