Refactor UnzipFileToMemory and getZipFileContents to use iterator#63
Open
wallclimber21 wants to merge 11 commits into
Open
Refactor UnzipFileToMemory and getZipFileContents to use iterator#63wallclimber21 wants to merge 11 commits into
wallclimber21 wants to merge 11 commits into
Conversation
- Fix specific files test: it didn't actually load the files
Owner
|
Can you rename the method to be "enumerate" instead of "iterate" to be consistent with NSArray, NSFileManager, NSFastEnumeration etc. |
Author
|
Not sure if it will automatically show up here, but there was a crucial bug in the unzip code, that I fixed after renaming the iterate to enumerate. It's already present in my tree. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch adds the following iterator function:
It loops over all entires in a zip file. For each entry, it first calls the CheckDecompressBlock to see if the file should be decompressed, and if so, then call the dataAcceptBlock with the decompressed data.
For some cases, this reduces the peak memory usage by orders of magnitude. (E.g. I have a .zip file with a thousand smaller entries that need to be imported into a sqlite database.)
The patch also refactors UnzipFileToMemory and getZipFileContents to use this iterator.