Skip to content

Commit 0e7aebd

Browse files
committed
Start cleaning up Quantum
1 parent 24afbb3 commit 0e7aebd

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

SabreTools.Compression/Quantum/Decompressor.cs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,47 +20,47 @@ public class Decompressor
2020
/// <summary>
2121
/// Selector 0: literal, 64 entries, starting symbol 0
2222
/// </summary>
23-
private Model _model0;
23+
private readonly Model _model0;
2424

2525
/// <summary>
2626
/// Selector 1: literal, 64 entries, starting symbol 64
2727
/// </summary>
28-
private Model _model1;
28+
private readonly Model _model1;
2929

3030
/// <summary>
3131
/// Selector 2: literal, 64 entries, starting symbol 128
3232
/// </summary>
33-
private Model _model2;
33+
private readonly Model _model2;
3434

3535
/// <summary>
3636
/// Selector 3: literal, 64 entries, starting symbol 192
3737
/// </summary>
38-
private Model _model3;
38+
private readonly Model _model3;
3939

4040
/// <summary>
4141
/// Selector 4: LZ, 3 character matches
4242
/// </summary>
43-
private Model _model4;
43+
private readonly Model _model4;
4444

4545
/// <summary>
4646
/// Selector 5: LZ, 4 character matches
4747
/// </summary>
48-
private Model _model5;
48+
private readonly Model _model5;
4949

5050
/// <summary>
5151
/// Selector 6: LZ, 5+ character matches
5252
/// </summary>
53-
private Model _model6;
53+
private readonly Model _model6;
5454

5555
/// <summary>
5656
/// Selector 6 length model
5757
/// </summary>
58-
private Model _model6len;
58+
private readonly Model _model6len;
5959

6060
/// <summary>
6161
/// Selector selector model
6262
/// </summary>
63-
private Model _selector;
63+
private readonly Model _selector;
6464

6565
#endregion
6666

@@ -105,25 +105,25 @@ public Decompressor(byte[]? input, uint windowBits)
105105
_bitStream = new ReadOnlyBitStream(ms);
106106

107107
// Initialize literal models
108-
this._model0 = CreateModel(0, 64);
109-
this._model1 = CreateModel(64, 64);
110-
this._model2 = CreateModel(128, 64);
111-
this._model3 = CreateModel(192, 64);
108+
_model0 = CreateModel(0, 64);
109+
_model1 = CreateModel(64, 64);
110+
_model2 = CreateModel(128, 64);
111+
_model3 = CreateModel(192, 64);
112112

113113
// Initialize LZ models
114114
int maxBitLength = (int)(windowBits * 2);
115-
this._model4 = CreateModel(0, maxBitLength > 24 ? 24 : maxBitLength);
116-
this._model5 = CreateModel(0, maxBitLength > 36 ? 36 : maxBitLength);
117-
this._model6 = CreateModel(0, maxBitLength);
118-
this._model6len = CreateModel(0, 27);
115+
_model4 = CreateModel(0, maxBitLength > 24 ? 24 : maxBitLength);
116+
_model5 = CreateModel(0, maxBitLength > 36 ? 36 : maxBitLength);
117+
_model6 = CreateModel(0, maxBitLength);
118+
_model6len = CreateModel(0, 27);
119119

120120
// Initialze the selector model
121-
this._selector = CreateModel(0, 7);
121+
_selector = CreateModel(0, 7);
122122

123123
// Initialize coding state
124-
this.CS_H = 0;
125-
this.CS_L = 0;
126-
this.CS_C = 0;
124+
CS_H = 0;
125+
CS_L = 0;
126+
CS_C = 0;
127127
}
128128

129129
/// <summary>
@@ -145,25 +145,25 @@ public Decompressor(Stream? input, uint windowBits)
145145
_bitStream = new ReadOnlyBitStream(input);
146146

147147
// Initialize literal models
148-
this._model0 = CreateModel(0, 64);
149-
this._model1 = CreateModel(64, 64);
150-
this._model2 = CreateModel(128, 64);
151-
this._model3 = CreateModel(192, 64);
148+
_model0 = CreateModel(0, 64);
149+
_model1 = CreateModel(64, 64);
150+
_model2 = CreateModel(128, 64);
151+
_model3 = CreateModel(192, 64);
152152

153153
// Initialize LZ models
154154
int maxBitLength = (int)(windowBits * 2);
155-
this._model4 = CreateModel(0, maxBitLength > 24 ? 24 : maxBitLength);
156-
this._model5 = CreateModel(0, maxBitLength > 36 ? 36 : maxBitLength);
157-
this._model6 = CreateModel(0, maxBitLength);
158-
this._model6len = CreateModel(0, 27);
155+
_model4 = CreateModel(0, maxBitLength > 24 ? 24 : maxBitLength);
156+
_model5 = CreateModel(0, maxBitLength > 36 ? 36 : maxBitLength);
157+
_model6 = CreateModel(0, maxBitLength);
158+
_model6len = CreateModel(0, 27);
159159

160160
// Initialze the selector model
161-
this._selector = CreateModel(0, 7);
161+
_selector = CreateModel(0, 7);
162162

163163
// Initialize coding state
164-
this.CS_H = 0;
165-
this.CS_L = 0;
166-
this.CS_C = 0;
164+
CS_H = 0;
165+
CS_L = 0;
166+
CS_C = 0;
167167
}
168168

169169
/// <summary>

0 commit comments

Comments
 (0)