From 4708522bd0078ca3c08ee5bc72acf15951fe6fb2 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 20 Sep 2018 09:22:18 -0700 Subject: [PATCH] Add ASExperimentalSkipClearData #trivial (#1136) * Add ASExperimentalSkipClearData * Move the experiment check within the if clause --- Source/ASCollectionView.mm | 3 ++- Source/ASExperimentalFeatures.h | 1 + Source/ASExperimentalFeatures.m | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/ASCollectionView.mm b/Source/ASCollectionView.mm index 69cd531478..94406b0eee 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -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]; } } diff --git a/Source/ASExperimentalFeatures.h b/Source/ASExperimentalFeatures.h index 26c228f8e9..e4bdf067fe 100644 --- a/Source/ASExperimentalFeatures.h +++ b/Source/ASExperimentalFeatures.h @@ -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 }; diff --git a/Source/ASExperimentalFeatures.m b/Source/ASExperimentalFeatures.m index b12891fd73..4be736033b 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -20,7 +20,8 @@ NSArray *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;