aws-sdk-js-v3
aws-sdk-js-v3 copied to clipboard
Update utils.ts
Remove redundant spread processKeysInObj
.
Description
Avoid unnecessary memory allocation.
Testing
Filter is already returning a shallow copy of the array see:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter#return_value
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#copying_an_array
Additional context
Found this allocation when looking for a memory leak using chrome developer tools (allocation sampling). Other places in the file correctly uses obj.filter
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.