Skip to content

Commit

Permalink
Remove size checks to reduce 10 test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtn committed Dec 11, 2019
1 parent aba7822 commit c2bbb1c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public ulong ReadPointerUnsafe(ulong addr)
public unsafe bool Read<T>(ulong addr, out T value) where T : unmanaged
{
Span<byte> buffer = stackalloc byte[sizeof(T)];
if (ReadMemory(addr, buffer, out int read) && read == sizeof(T))
if (ReadMemory(addr, buffer, out int _))
{
value = Unsafe.As<byte, T>(ref buffer[0]);
return true;
Expand All @@ -178,7 +178,7 @@ public T ReadUnsafe<T>(ulong addr) where T : unmanaged
public bool ReadPointer(ulong address, out ulong value)
{
Span<byte> buffer = stackalloc byte[IntPtr.Size];
if (ReadMemory(address, buffer, out int read) && read == IntPtr.Size)
if (ReadMemory(address, buffer, out int _))
{
value = buffer.AsPointer();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public ulong ReadPointerUnsafe(ulong addr)
public unsafe bool Read<T>(ulong addr, out T value) where T : unmanaged
{
Span<byte> buffer = stackalloc byte[sizeof(T)];
if (ReadMemory(addr, buffer, out int read) && read == sizeof(T))
if (ReadMemory(addr, buffer, out int _))
{
value = Unsafe.As<byte, T>(ref buffer[0]);
return true;
Expand All @@ -294,7 +294,7 @@ public T ReadUnsafe<T>(ulong addr) where T : unmanaged
public bool ReadPointer(ulong address, out ulong value)
{
Span<byte> buffer = stackalloc byte[IntPtr.Size];
if (ReadMemory(address, buffer, out int read) && read == IntPtr.Size)
if (ReadMemory(address, buffer, out int _))
{
value = buffer.AsPointer();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public ulong ReadPointerUnsafe(ulong addr)
public unsafe bool Read<T>(ulong addr, out T value) where T : unmanaged
{
Span<byte> buffer = stackalloc byte[sizeof(T)];
if (ReadMemory(addr, buffer, out int read) && read == sizeof(T))
if (ReadMemory(addr, buffer, out int _))
{
value = Unsafe.As<byte, T>(ref buffer[0]);
return true;
Expand All @@ -213,7 +213,7 @@ public T ReadUnsafe<T>(ulong addr) where T : unmanaged
public bool ReadPointer(ulong address, out ulong value)
{
Span<byte> buffer = stackalloc byte[IntPtr.Size];
if (ReadMemory(address, buffer, out int read) && read == IntPtr.Size)
if (ReadMemory(address, buffer, out int _))
{
value = buffer.AsPointer();
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public ulong ReadPointerUnsafe(ulong address)
public unsafe bool Read<T>(ulong addr, out T value) where T : unmanaged
{
Span<byte> buffer = stackalloc byte[sizeof(T)];
if (ReadMemory(addr, buffer, out int read) && read == sizeof(T))
if (ReadMemory(addr, buffer, out int _))
{
value = Unsafe.As<byte, T>(ref buffer[0]);
return true;
Expand All @@ -200,7 +200,7 @@ public T ReadUnsafe<T>(ulong addr) where T : unmanaged
public bool ReadPointer(ulong address, out ulong value)
{
Span<byte> buffer = stackalloc byte[IntPtr.Size];
if (ReadMemory(address, buffer, out int read) && read == IntPtr.Size)
if (ReadMemory(address, buffer, out int _))
{
value = buffer.AsPointer();
return true;
Expand Down

0 comments on commit c2bbb1c

Please sign in to comment.