Skip to content

Commit

Permalink
- Minor memory optimizations
Browse files Browse the repository at this point in the history
- Updated to latest SDK
  • Loading branch information
felix-schwarz committed Nov 26, 2018
1 parent acda9ee commit f669ae8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
26 changes: 23 additions & 3 deletions ownCloud File Provider/FileProviderEnumerator.m
Original file line number Diff line number Diff line change
Expand Up @@ -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 <OCItem *> *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<OCItem *> *partialResults = [queryResults subarrayWithRange:NSMakeRange(offset, sliceCount)];
//
// [observer.enumerationObserver didEnumerateItems:partialResults];
//
// offset += sliceCount;
// };

[observer.enumerationObserver didEnumerateItems:queryResults];
}

[observer.enumerationObserver finishEnumeratingUpToPage:nil];
Expand Down

0 comments on commit f669ae8

Please sign in to comment.