1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 21:08:56 -05:00

perf(webidl): optimize createDictionaryConverter() (#12279)

On a benchmark constructing Responses with headers this shaves off 25%
This commit is contained in:
Aaron O'Mullan 2021-09-30 21:33:12 +02:00 committed by Ryan Dahl
parent c79fd8f419
commit fec0f1c8bb

View file

@ -41,6 +41,7 @@
NumberMAX_SAFE_INTEGER,
// deno-lint-ignore camelcase
NumberMIN_SAFE_INTEGER,
ObjectAssign,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
@ -726,7 +727,7 @@
}
const esDict = V;
const idlDict = { ...defaultValues };
const idlDict = ObjectAssign({}, defaultValues);
// NOTE: fast path Null and Undefined.
if ((V === undefined || V === null) && !hasRequiredKey) {