Commit e3421ac2 authored by Anton Khlynovskiy's avatar Anton Khlynovskiy Committed by Jeremiah Senkpiel
Browse files

lib: freelist: use .pop() for allocation

Array#pop() is known to be faster than Array#shift().
To be exact, it's O(1) vs. O(n). In this case there's no difference
from which side of the "pool" array the object is retrieved,
so .pop() should be preferred.

PR-URL: https://github.com/nodejs/node/pull/2174


Reviewed-By: default avatarmscdex - Brian White <mscdex@mscdex.net>
Reviewed-By: default avatarjasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: default avatarofrobots - Ali Ijaz Sheikh <ofrobots@google.com>
parent 51bc062d
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment