mirror of
https://github.com/aaru-dps/AaruBenchmark.git
synced 2025-12-16 19:24:36 +00:00
Reformat and cleanup.
This commit is contained in:
@@ -44,10 +44,10 @@ public class AppleRle
|
||||
/// <returns>The number of decoded bytes</returns>
|
||||
public static int DecodeBuffer(byte[] source, byte[] destination)
|
||||
{
|
||||
int count = 0;
|
||||
bool nextA = true; // true if A, false if B
|
||||
var count = 0;
|
||||
var nextA = true; // true if A, false if B
|
||||
byte repeatedByteA = 0, repeatedByteB = 0;
|
||||
bool repeatMode = false; // true if we're repeating, false if we're just copying
|
||||
var repeatMode = false; // true if we're repeating, false if we're just copying
|
||||
int inPosition = 0, outPosition = 0;
|
||||
|
||||
while(inPosition <= source.Length &&
|
||||
@@ -87,9 +87,9 @@ public class AppleRle
|
||||
|
||||
while(true)
|
||||
{
|
||||
byte b1 = source[inPosition++];
|
||||
byte b2 = source[inPosition++];
|
||||
short s = (short)((b1 << 8) | b2);
|
||||
byte b1 = source[inPosition++];
|
||||
byte b2 = source[inPosition++];
|
||||
var s = (short)(b1 << 8 | b2);
|
||||
|
||||
if(s == 0 ||
|
||||
s >= DART_CHUNK ||
|
||||
@@ -101,7 +101,7 @@ public class AppleRle
|
||||
repeatMode = true;
|
||||
repeatedByteA = source[inPosition++];
|
||||
repeatedByteB = source[inPosition++];
|
||||
count = (-s * 2) - 1;
|
||||
count = -s * 2 - 1;
|
||||
nextA = false;
|
||||
|
||||
destination[outPosition++] = repeatedByteA;
|
||||
@@ -110,7 +110,7 @@ public class AppleRle
|
||||
}
|
||||
|
||||
repeatMode = false;
|
||||
count = (s * 2) - 1;
|
||||
count = s * 2 - 1;
|
||||
|
||||
destination[outPosition++] = source[inPosition++];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user