Skip to content

Commit

Permalink
Improve performance of ValuelistUtil.getValuesOfParentField
Browse files Browse the repository at this point in the history
  • Loading branch information
tkleinke committed May 22, 2024
1 parent 9bb0d03 commit d69a9ff
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/src/tools/valuelist-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ export module ValuelistUtil {

const parentValues: string[] = parentResource[fieldName] ?? [];

const result: Valuelist = clone(valuelist);
result.values = filter((_, key: string) => {
return parentValues.includes(key);
})(valuelist.values) as { [key: string]: ValuelistValue };

return result;
return {
id: valuelist.id,
values: filter((_, key: string) => {
return parentValues.includes(key);
})(valuelist.values) as { [key: string]: ValuelistValue }
};
}
}

0 comments on commit d69a9ff

Please sign in to comment.