Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8c07524
Avoid unnecessary byte[] allocations
stephentoub Aug 19, 2022
53d24d0
Remove unnecessary use of FileStreamOptions
stephentoub Aug 19, 2022
c9dc0be
Clean up Dispose{Async} implementations
stephentoub Aug 19, 2022
4e1af20
Clean up unnecessary consts
stephentoub Aug 19, 2022
13f011b
Remove MemoryStream/Encoding.UTF8.GetBytes allocations, unnecessary a…
stephentoub Aug 19, 2022
8735a67
Avoid string allocations in ReadMagicAttribute
stephentoub Aug 19, 2022
f50edcf
Avoid allocation in WriteAsOctal
stephentoub Aug 19, 2022
29a90d3
Improve handling of octal
stephentoub Aug 19, 2022
e211457
Avoid allocation for version string
stephentoub Aug 19, 2022
868a20c
Removing boxing and char string allocation in GenerateExtendedAttribu…
stephentoub Aug 19, 2022
c83e97c
Fix a couple unnecessary dictionary lookups
stephentoub Aug 19, 2022
82b8909
Replace Enum.HasFlag usage
stephentoub Aug 19, 2022
60145e9
Remove allocations from Write{Posix}Name
stephentoub Aug 19, 2022
e9a32ec
Replace ArrayPool use with string.Create
stephentoub Aug 19, 2022
d632a95
Replace more superfluous ArrayPool usage
stephentoub Aug 19, 2022
fbf22b3
Remove ArrayPool use from System.IO.Compression.ZipFile
stephentoub Aug 20, 2022
60d9352
Fix inverted condition
stephentoub Aug 20, 2022
24aa3a2
Use generic math to parse octal
stephentoub Aug 20, 2022
25b32ff
Remove allocations from StringReader and string.Split
stephentoub Aug 20, 2022
9649015
Remove magic string allocation for Ustar when not V7
stephentoub Aug 20, 2022
c5a8bfe
Remove file name and directory name allocation in GenerateExtendedAtt…
stephentoub Aug 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove magic string allocation for Ustar when not V7
  • Loading branch information
stephentoub authored and github-actions committed Aug 21, 2022
commit 964901557848f024529f20123042da6fb8c5837b
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,14 @@ private void ReadMagicAttribute(Span<byte> buffer)
_magic = GnuMagic;
_format = TarEntryFormat.Gnu;
}
else if (_format == TarEntryFormat.V7 && magic.SequenceEqual(UstarMagicBytes))
else if (magic.SequenceEqual(UstarMagicBytes))
{
// Important: Only change to ustar if we had not changed the format to pax already
_magic = UstarMagic;
_format = TarEntryFormat.Ustar;
if (_format == TarEntryFormat.V7)
{
// Important: Only change to ustar if we had not changed the format to pax already
_format = TarEntryFormat.Ustar;
}
}
else
{
Expand Down