From 1b9a26f0f6492640f1900628ee1a1d54fdd0d24a 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 69cd53147..94406b0ee 100644 --- a/Source/ASCollectionView.mm +++ b/Source/ASCollectionView.mm @@ -576,7 +576,8 @@ - (void)setAsyncDelegate:(id)asyncDelegate - (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 26c228f8e..e4bdf067f 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 b12891fd7..4be736033 100644 --- a/Source/ASExperimentalFeatures.m +++ b/Source/ASExperimentalFeatures.m @@ -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;