From 05ec52e44ef94d7b47c763b416d2ded5017fa905 Mon Sep 17 00:00:00 2001 From: Felix Schwarz Date: Mon, 26 Nov 2018 10:26:02 +0100 Subject: [PATCH] - Minor memory optimizations - Updated to latest SDK --- ios-sdk | 2 +- .../FileProviderEnumerator.m | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ios-sdk b/ios-sdk index b31f81384..e03daf376 160000 --- a/ios-sdk +++ b/ios-sdk @@ -1 +1 @@ -Subproject commit b31f813843203fbaf1db5928a553e7989d0db923 +Subproject commit e03daf37605610d0ca4cbff95c9d99640023baf6 diff --git a/ownCloud File Provider/FileProviderEnumerator.m b/ownCloud File Provider/FileProviderEnumerator.m index 1e0c0d197..13b9d168e 100644 --- a/ownCloud File Provider/FileProviderEnumerator.m +++ b/ownCloud File Provider/FileProviderEnumerator.m @@ -234,13 +234,33 @@ - (void)provideItemsForEnumerationObserverFromQuery:(OCQuery *)query { if (!observer.didProvideInitialItems) { - OCLogDebug(@"##### PROVIDE ITEMS TO %ld --ENUMERATION-- OBSERVER %@ FOR %@: %@", _enumerationObservers.count, observer.enumerationObserver, query.queryPath, query.queryResults); + NSArray *queryResults = query.queryResults; + + OCLogDebug(@"##### PROVIDE ITEMS TO %ld --ENUMERATION-- OBSERVER %@ FOR %@: %@", _enumerationObservers.count, observer.enumerationObserver, query.queryPath, queryResults); observer.didProvideInitialItems = YES; - if (query.queryResults != nil) + if (queryResults != nil) { - [observer.enumerationObserver didEnumerateItems:query.queryResults]; +// NSUInteger offset = 0, count = queryResults.count; +// +// while (offset < count) +// { +// NSUInteger sliceCount = 100; +// +// if (offset + sliceCount > count) +// { +// sliceCount = count - offset; +// } +// +// NSArray *partialResults = [queryResults subarrayWithRange:NSMakeRange(offset, sliceCount)]; +// +// [observer.enumerationObserver didEnumerateItems:partialResults]; +// +// offset += sliceCount; +// }; + + [observer.enumerationObserver didEnumerateItems:queryResults]; } [observer.enumerationObserver finishEnumeratingUpToPage:nil];