Skip to content

Commit

Permalink
Add ASExperimentalSkipClearData #trivial (TextureGroup#1136)
Browse files Browse the repository at this point in the history
* Add ASExperimentalSkipClearData

* Move the experiment check within the if clause
  • Loading branch information
maicki authored and nguyenhuy committed Sep 20, 2018
1 parent 21f5b61 commit 1b9a26f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,8 @@ - (void)setAsyncDelegate:(id<ASCollectionDelegate>)asyncDelegate
- (void)_asyncDelegateOrDataSourceDidChange
{
ASDisplayNodeAssertMainThread();
if (_asyncDataSource == nil && _asyncDelegate == nil) {

if (_asyncDataSource == nil && _asyncDelegate == nil && !ASActivateExperimentalFeature(ASExperimentalSkipClearData)) {
[_dataController clearData];
}
}
Expand Down
1 change: 1 addition & 0 deletions Source/ASExperimentalFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ typedef NS_OPTIONS(NSUInteger, ASExperimentalFeatures) {
ASExperimentalDeallocQueue = 1 << 6, // exp_dealloc_queue_v2
ASExperimentalCollectionTeardown = 1 << 7, // exp_collection_teardown
ASExperimentalFramesetterCache = 1 << 8, // exp_framesetter_cache
ASExperimentalSkipClearData = 1 << 9, // exp_skip_clear_data
ASExperimentalFeatureAll = 0xFFFFFFFF
};

Expand Down
3 changes: 2 additions & 1 deletion Source/ASExperimentalFeatures.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
@"exp_network_image_queue",
@"exp_dealloc_queue_v2",
@"exp_collection_teardown",
@"exp_framesetter_cache"]));
@"exp_framesetter_cache"
@"exp_skip_clear_data"]));

if (flags == ASExperimentalFeatureAll) {
return allNames;
Expand Down

0 comments on commit 1b9a26f

Please sign in to comment.