Skip to content

Commit

Permalink
Use BOOL for enableState instead of NSNumber
Browse files Browse the repository at this point in the history
  • Loading branch information
jzucker2 committed Mar 10, 2016
1 parent 6b760a5 commit 5a43e45
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions OHHTTPStubs/Sources/OHHTTPStubs.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ @interface OHHTTPStubsProtocol : NSURLProtocol @end
@interface OHHTTPStubs()
+ (instancetype)sharedInstance;
@property(atomic, copy) NSMutableArray* stubDescriptors;
@property(atomic, copy) NSNumber* enabledStateNumber;
@property(atomic, assign) BOOL enabledState;
@property(atomic, copy, nullable) void (^onStubActivationBlock)(NSURLRequest*, id<OHHTTPStubsDescriptor>);
@end

Expand Down Expand Up @@ -115,7 +115,7 @@ - (instancetype)init
if (self)
{
_stubDescriptors = [NSMutableArray array];
_enabledStateNumber = @YES; // assume initialize has already been run
_enabledState = YES; // assume initialize has already been run
}
return self;
}
Expand Down Expand Up @@ -248,7 +248,7 @@ -(BOOL)isEnabled
BOOL enabled = NO;
@synchronized(self)
{
enabled = _enabledStateNumber.boolValue;
enabled = _enabledState;
}
return enabled;
}
Expand All @@ -257,8 +257,8 @@ -(void)setEnabled:(BOOL)enable
{
@synchronized(self)
{
_enabledStateNumber = @(enable);
[self.class _setEnable:enable];
_enabledState = enable;
[self.class _setEnable:_enabledState];
}
}

Expand Down

0 comments on commit 5a43e45

Please sign in to comment.