Skip to content

Commit eb400b8

Browse files
committed
perf(napi/parser, linter/plugins): remove uint32 buffer view (#21140)
Continuation of #21132. All uses of the `Uint32Array` view of the buffer in raw transfer code have been removed in preceding PRs. So we can now remove it entirely.
1 parent 2675085 commit eb400b8

14 files changed

Lines changed: 9 additions & 25 deletions

File tree

apps/oxlint/src-js/generated/deserialize.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type { Program } from "./types.d.ts";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

apps/oxlint/src-js/package/parse.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export function initBuffer() {
9999
const arrayBuffer = new ArrayBuffer(ARRAY_BUFFER_SIZE);
100100
const offset = getBufferOffset(new Uint8Array(arrayBuffer));
101101
buffer = new Uint8Array(arrayBuffer, offset, BUFFER_SIZE) as BufferWithArrays;
102-
buffer.uint32 = new Uint32Array(arrayBuffer, offset, BUFFER_SIZE / 4);
103102
buffer.int32 = new Int32Array(arrayBuffer, offset, BUFFER_SIZE / 4);
104103
buffer.float64 = new Float64Array(arrayBuffer, offset, BUFFER_SIZE / 8);
105104

apps/oxlint/src-js/plugins/lint.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export function lintFileImpl(
132132
} else {
133133
typeAssertIs<BufferWithArrays>(buffer);
134134
const { buffer: arrayBuffer, byteOffset } = buffer;
135-
buffer.uint32 = new Uint32Array(arrayBuffer, byteOffset);
136135
buffer.int32 = new Int32Array(arrayBuffer, byteOffset);
137136
buffer.float64 = new Float64Array(arrayBuffer, byteOffset);
138137

apps/oxlint/src-js/plugins/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ export type NodeOrToken = Node | Token | Comment;
2525

2626
// Buffer with typed array views of itself stored as properties.
2727
export interface BufferWithArrays extends Uint8Array {
28-
uint32: Uint32Array;
2928
int32: Int32Array;
3029
float64: Float64Array;
3130
}

napi/parser/src-js/generated/deserialize/js.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type * as ESTree from "@oxc-project/types";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

napi/parser/src-js/generated/deserialize/js_parent.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type * as ESTree from "@oxc-project/types";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

napi/parser/src-js/generated/deserialize/js_range.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type * as ESTree from "@oxc-project/types";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

napi/parser/src-js/generated/deserialize/js_range_parent.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type * as ESTree from "@oxc-project/types";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

napi/parser/src-js/generated/deserialize/ts.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type * as ESTree from "@oxc-project/types";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

napi/parser/src-js/generated/deserialize/ts_parent.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import type * as ESTree from "@oxc-project/types";
55

66
type BufferWithArrays = Uint8Array & {
7-
uint32: Uint32Array;
87
int32: Int32Array;
98
float64: Float64Array;
109
};

0 commit comments

Comments
 (0)