Skip to content

Commit c96ee81

Browse files
committed
Simplify fixed statements
1 parent f6201e2 commit c96ee81

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

SabreTools.Serialization/Wrappers/InstallShieldCabinet.Extraction.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,7 @@ public bool FileSaveRaw(int index, string filename)
456456
/// </summary>
457457
private unsafe static int Uncompress(byte[] dest, ref long destLen, byte[] source, ref ulong sourceLen)
458458
{
459-
fixed (byte* sourcePtr = source)
460-
fixed (byte* destPtr = dest)
459+
fixed (byte* sourcePtr = source, destPtr = dest)
461460
{
462461
var stream = new ZLib.z_stream_s
463462
{
@@ -490,8 +489,7 @@ private unsafe static int Uncompress(byte[] dest, ref long destLen, byte[] sourc
490489
/// </summary>
491490
private unsafe static int UncompressOld(byte[] dest, ref long destLen, byte[] source, ref ulong sourceLen)
492491
{
493-
fixed (byte* sourcePtr = source)
494-
fixed (byte* destPtr = dest)
492+
fixed (byte* sourcePtr = source, destPtr = dest)
495493
{
496494
var stream = new ZLib.z_stream_s
497495
{

SabreTools.Serialization/Wrappers/PortableExecutable.Extraction.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,7 @@ public bool ExtractWiseSection(string outputDirectory, bool includeDebug)
793793
byte[] data = new byte[resource.Length * 4];
794794
unsafe
795795
{
796-
fixed (byte* payloadPtr = resource)
797-
fixed (byte* dataPtr = data)
796+
fixed (byte* payloadPtr = resource, dataPtr = data)
798797
{
799798
zstream.next_in = payloadPtr;
800799
zstream.avail_in = (uint)resource.Length;

SabreTools.Serialization/Wrappers/SGA.Extraction.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ public bool ExtractFile(int index, string outputDirectory, bool includeDebug)
9898
data = new byte[outputFileSize];
9999
unsafe
100100
{
101-
fixed (byte* payloadPtr = compressedData)
102-
fixed (byte* dataPtr = data)
101+
fixed (byte* payloadPtr = compressedData, dataPtr = data)
103102
{
104103
zstream.next_in = payloadPtr;
105104
zstream.avail_in = (uint)compressedData.Length;

0 commit comments

Comments
 (0)