mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #27] Changed the order of detecting whether the archive is in .rar format. #796
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/27
State: closed
Merged: Yes
Detecting whether the archive is in .rar format currently requires reading entire archive byte by byte
which is very slow when the archive is big and as it's done before checking for .tar and .7z formats, so the opening of archive is very slow even for those formats.
Because of this I have reordered the checks, so that detecting if this is RAR archive is done last, so that .tar and .7z formats can be loaded fast and entire archive checking will only occur when the archive is in unsupported format.
I'm not sure whether the checking of entire archive is required for RAR format, so I didn't touch it.