Skip to content

Commit

Permalink
micro-optimization for set building
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Aug 10, 2023
1 parent e90c936 commit de164ee
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/core/JsonParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,12 +820,11 @@ export class JsonParser<T> {
}

if (jsonCreatorMode !== JsonCreatorMode.DELEGATING) {
const keysToBeExcluded = new Set([
...propNames,
...propNamesAliasToBeExcluded,
...jsonAppendAttributesToBeExcluded,
...classPropertiesToBeExcluded
]);
const keysToBeExcluded = new Set();
propNames.forEach((el) => keysToBeExcluded.add(el));
propNamesAliasToBeExcluded.forEach((el) => keysToBeExcluded.add(el));
jsonAppendAttributesToBeExcluded.forEach((el) => keysToBeExcluded.add(el));
classPropertiesToBeExcluded.forEach((el) => keysToBeExcluded.add(el));

const classKeys = getClassProperties(currentMainCreator, obj, context, {
withSettersAsProperty: true
Expand Down

0 comments on commit de164ee

Please sign in to comment.