Skip to content

Commit

Permalink
perf(webidl): optimize createDictionaryConverter() (#12279)
Browse files Browse the repository at this point in the history
On a benchmark constructing Responses with headers this shaves off 25%
  • Loading branch information
AaronO authored and ry committed Oct 4, 2021
1 parent c79fd8f commit fec0f1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ext/webidl/00_webidl.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
NumberMAX_SAFE_INTEGER,
// deno-lint-ignore camelcase
NumberMIN_SAFE_INTEGER,
ObjectAssign,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fec0f1c

Please sign in to comment.