Skip to content

Commit c36eb39

Browse files
committed
perf: add typed arrays
1 parent 9cf16e0 commit c36eb39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/fetch.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {
1616
} from "./types";
1717

1818
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
19-
const retryStatusCodes = new Set([
19+
const retryStatusCodes = new Set(new Int16Array([
2020
408, // Request Timeout
2121
409, // Conflict
2222
425, // Too Early (Experimental)
@@ -25,10 +25,10 @@ const retryStatusCodes = new Set([
2525
502, // Bad Gateway
2626
503, // Service Unavailable
2727
504, // Gateway Timeout
28-
]);
28+
]));
2929

3030
// https://developer.mozilla.org/en-US/docs/Web/API/Response/body
31-
const nullBodyResponses = new Set([101, 204, 205, 304]);
31+
const nullBodyResponses = new Set(new Int16Array([101, 204, 205, 304]));
3232

3333
export function createFetch(globalOptions: CreateFetchOptions = {}): $Fetch {
3434
const {

0 commit comments

Comments
 (0)