Add ASExperimentalSkipClearData #trivial (#1136)

* Add ASExperimentalSkipClearData

* Move the experiment check within the if clause
This commit is contained in:
Michael Schneider
2018-09-20 09:22:18 -07:00
committed by GitHub
parent 696f344301
commit 4708522bd0
3 changed files with 5 additions and 2 deletions

View File

@@ -576,7 +576,8 @@ static NSString * const kReuseIdentifier = @"_ASCollectionReuseIdentifier";
- (void)_asyncDelegateOrDataSourceDidChange
{
ASDisplayNodeAssertMainThread();
if (_asyncDataSource == nil && _asyncDelegate == nil) {
if (_asyncDataSource == nil && _asyncDelegate == nil && !ASActivateExperimentalFeature(ASExperimentalSkipClearData)) {
[_dataController clearData];
}
}

View File

@@ -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
};

View File

@@ -20,7 +20,8 @@ NSArray<NSString *> *ASExperimentalFeaturesGetNames(ASExperimentalFeatures flags
@"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;