Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions

View file

@ -12,7 +12,7 @@ auto compress(in string original) pure nothrow {
w = w ~ ch;
else {
result ~= dict[w];
dict[w ~ ch] = dict.length;
dict[w ~ ch] = cast(int)dict.length;
w = [ch];
}
return w.empty ? result : (result ~ dict[w]);

View file

@ -9,7 +9,7 @@ struct LZW {
enum int initDictSize = 256;
static immutable ubyte[initDictSize] bytes;
static this() {
shared static this() {
foreach (immutable T i; 0 .. initDictSize)
bytes[i] = i;
}
@ -18,7 +18,7 @@ struct LZW {
out(result) {
if (!original.empty)
assert(result[0] < initDictSize);
} body {
} do {
if (original.empty)
return [];
Tcomp[Ta] dict;
@ -57,7 +57,7 @@ struct LZW {
in {
if (!compressed.empty)
assert(compressed[0] < initDictSize, "Bad compressed");
} body {
} do {
if (compressed.empty)
return [];

View file

@ -8,7 +8,7 @@ enum Marker: ushort {
ubyte[] lzwEncode(scope const(ubyte)[] inp, in uint maxBits) pure nothrow
in {
assert(maxBits >= 9 && maxBits <= 16);
} body {
} do {
// Encode dictionary array. For encoding, entry at
// code index is a list of indices that follow current one,
// i.e. if code 97 is 'a', code 387 is 'ab', and code 1022 is 'abc',
@ -148,7 +148,7 @@ ubyte[] lzwDecode(scope const(ubyte)[] inp) pure {
}
clearTable(); // In case encoded bits didn't start with Marker.CLR.
for (len = inp.length; len;) {
for (len = cast(int)inp.length; len;) {
getCode();
if (code == Marker.EOD)
break;