We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1dd1d7d + 3d50366 commit 2589c87Copy full SHA for 2589c87
src/Decoder.ts
@@ -23,6 +23,7 @@ type StackArrayState = {
23
type: State.ARRAY;
24
size: number;
25
array: Array<unknown>;
26
+ position: number;
27
};
28
29
type StackState = StackArrayState | StackMapState;
@@ -314,8 +315,9 @@ export class Decoder {
314
315
// arrays and maps
316
const state = stack[stack.length - 1];
317
if (state.type === State.ARRAY) {
- state.array.push(object);
318
- if (state.array.length === state.size) {
+ state.array[state.position] = object;
319
+ state.position++;
320
+ if (state.position === state.size) {
321
stack.pop();
322
object = state.array;
323
} else {
@@ -383,7 +385,8 @@ export class Decoder {
383
385
this.stack.push({
384
386
type: State.ARRAY,
387
size,
- array: [],
388
+ array: new Array<unknown>(size),
389
+ position: 0,
390
});
391
}
392
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments