General refactor and cleanup.

This commit is contained in:
2024-04-30 04:30:11 +01:00
parent 886bd83e85
commit fa6f1b2e46
34 changed files with 2153 additions and 2226 deletions

View File

@@ -50,8 +50,7 @@ public class AppleRle
var repeatMode = false; // true if we're repeating, false if we're just copying
int inPosition = 0, outPosition = 0;
while(inPosition <= source.Length &&
outPosition <= destination.Length)
while(inPosition <= source.Length && outPosition <= destination.Length)
{
switch(repeatMode)
{
@@ -82,8 +81,7 @@ public class AppleRle
continue;
}
if(inPosition == source.Length)
break;
if(inPosition == source.Length) break;
while(true)
{
@@ -91,10 +89,7 @@ public class AppleRle
byte b2 = source[inPosition++];
var s = (short)(b1 << 8 | b2);
if(s == 0 ||
s >= DART_CHUNK ||
s <= -DART_CHUNK)
continue;
if(s == 0 || s >= DART_CHUNK || s <= -DART_CHUNK) continue;
if(s < 0)
{