Skip to content

Commit ae8ffbc

Browse files
committed
Fix bug.
#13
1 parent 4d9f47a commit ae8ffbc

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

MessageThrottle.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "MessageThrottle"
3-
s.version = "1.3.1"
3+
s.version = "1.3.2"
44
s.summary = "A lightweight Objective-C message throttle and debounce library."
55
s.description = <<-DESC
66
MessageThrottle is a lightweight, simple library for controlling frequency of forwarding Objective-C messages. You can choose to control existing methods per instance or per class. It's an implementation of function throttle/debounce developed with Objective-C runtime.

MessageThrottle/MessageThrottle.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,13 @@ - (BOOL)applyRule:(MTRule *)rule
438438
__block BOOL shouldApply = YES;
439439
if (mt_checkRuleValid(rule)) {
440440
for (id target in [[self.targetSELs keyEnumerator] allObjects]) {
441-
if (target == rule.target) {
442-
shouldApply = NO;
443-
continue;
444-
}
445441
NSMutableSet *selectors = [self.targetSELs objectForKey:target];
446442
NSString *selectorName = NSStringFromSelector(rule.selector);
447443
if ([selectors containsObject:selectorName]) {
444+
if (target == rule.target) {
445+
shouldApply = NO;
446+
continue;
447+
}
448448
if (mt_object_isClass(rule.target) && mt_object_isClass(target)) {
449449
Class clsA = rule.target;
450450
Class clsB = target;

0 commit comments

Comments
 (0)