perf: no need to create a new array and new anonymous function by cesco69 · Pull Request #3572 · brianc/node-postgres

@cesco69

this._idle.slice().map( ... ) create a new array and new anonymous function every time

@cesco69 cesco69 marked this pull request as ready for review

December 16, 2025 10:38

charmander

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This calls end/emits removes in a different order, which is probably fine – but it’s also a real microoptimization, especially compared to some of the other stuff the pool does…

@cesco69