Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions TMCache/TMDiskCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ - (TMDiskCacheObjectBlock)willAddObjectBlock
__block TMDiskCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _willAddObjectBlock;
block = self->_willAddObjectBlock;
});

return block;
Expand All @@ -886,7 +886,7 @@ - (TMDiskCacheObjectBlock)willRemoveObjectBlock
__block TMDiskCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _willRemoveObjectBlock;
block = self->_willRemoveObjectBlock;
});

return block;
Expand All @@ -910,7 +910,7 @@ - (TMDiskCacheBlock)willRemoveAllObjectsBlock
__block TMDiskCacheBlock block = nil;

dispatch_sync(_queue, ^{
block = _willRemoveAllObjectsBlock;
block = self->_willRemoveAllObjectsBlock;
});

return block;
Expand All @@ -934,7 +934,7 @@ - (TMDiskCacheObjectBlock)didAddObjectBlock
__block TMDiskCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _didAddObjectBlock;
block = self->_didAddObjectBlock;
});

return block;
Expand All @@ -958,7 +958,7 @@ - (TMDiskCacheObjectBlock)didRemoveObjectBlock
__block TMDiskCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _didRemoveObjectBlock;
block = self->_didRemoveObjectBlock;
});

return block;
Expand All @@ -982,7 +982,7 @@ - (TMDiskCacheBlock)didRemoveAllObjectsBlock
__block TMDiskCacheBlock block = nil;

dispatch_sync(_queue, ^{
block = _didRemoveAllObjectsBlock;
block = self->_didRemoveAllObjectsBlock;
});

return block;
Expand All @@ -1006,7 +1006,7 @@ - (NSUInteger)byteLimit
__block NSUInteger byteLimit = 0;

dispatch_sync(_queue, ^{
byteLimit = _byteLimit;
byteLimit = self->_byteLimit;
});

return byteLimit;
Expand All @@ -1033,7 +1033,7 @@ - (NSTimeInterval)ageLimit
__block NSTimeInterval ageLimit = 0.0;

dispatch_sync(_queue, ^{
ageLimit = _ageLimit;
ageLimit = self->_ageLimit;
});

return ageLimit;
Expand Down
22 changes: 11 additions & 11 deletions TMCache/TMMemoryCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ - (void)setObject:(id)object forKey:(NSString *)key withCost:(NSUInteger)cost bl
[strongSelf->_dates setObject:now forKey:key];
[strongSelf->_costs setObject:@(cost) forKey:key];

_totalCost += cost;
strongSelf->_totalCost += cost;

if (strongSelf->_didAddObjectBlock)
strongSelf->_didAddObjectBlock(strongSelf, key, object);
Expand Down Expand Up @@ -652,7 +652,7 @@ - (TMMemoryCacheObjectBlock)willRemoveObjectBlock
__block TMMemoryCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _willRemoveObjectBlock;
block = self->_willRemoveObjectBlock;
});

return block;
Expand All @@ -676,7 +676,7 @@ - (TMMemoryCacheBlock)willRemoveAllObjectsBlock
__block TMMemoryCacheBlock block = nil;

dispatch_sync(_queue, ^{
block = _willRemoveAllObjectsBlock;
block = self->_willRemoveAllObjectsBlock;
});

return block;
Expand All @@ -700,7 +700,7 @@ - (TMMemoryCacheObjectBlock)didAddObjectBlock
__block TMMemoryCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _didAddObjectBlock;
block = self->_didAddObjectBlock;
});

return block;
Expand All @@ -724,7 +724,7 @@ - (TMMemoryCacheObjectBlock)didRemoveObjectBlock
__block TMMemoryCacheObjectBlock block = nil;

dispatch_sync(_queue, ^{
block = _didRemoveObjectBlock;
block = self->_didRemoveObjectBlock;
});

return block;
Expand All @@ -748,7 +748,7 @@ - (TMMemoryCacheBlock)didRemoveAllObjectsBlock
__block TMMemoryCacheBlock block = nil;

dispatch_sync(_queue, ^{
block = _didRemoveAllObjectsBlock;
block = self->_didRemoveAllObjectsBlock;
});

return block;
Expand All @@ -772,7 +772,7 @@ - (TMMemoryCacheBlock)didReceiveMemoryWarningBlock
__block TMMemoryCacheBlock block = nil;

dispatch_sync(_queue, ^{
block = _didReceiveMemoryWarningBlock;
block = self->_didReceiveMemoryWarningBlock;
});

return block;
Expand All @@ -796,7 +796,7 @@ - (TMMemoryCacheBlock)didEnterBackgroundBlock
__block TMMemoryCacheBlock block = nil;

dispatch_sync(_queue, ^{
block = _didEnterBackgroundBlock;
block = self->_didEnterBackgroundBlock;
});

return block;
Expand All @@ -820,7 +820,7 @@ - (NSTimeInterval)ageLimit
__block NSTimeInterval ageLimit = 0.0;

dispatch_sync(_queue, ^{
ageLimit = _ageLimit;
ageLimit = self->_ageLimit;
});

return ageLimit;
Expand All @@ -846,7 +846,7 @@ - (NSUInteger)costLimit
__block NSUInteger costLimit = 0;

dispatch_sync(_queue, ^{
costLimit = _costLimit;
costLimit = self->_costLimit;
});

return costLimit;
Expand All @@ -873,7 +873,7 @@ - (NSUInteger)totalCost
__block NSUInteger cost = 0;

dispatch_sync(_queue, ^{
cost = _totalCost;
cost = self->_totalCost;
});

return cost;
Expand Down