Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid using deprecated Buffer constructor
Use Buffer.allocUnsafe directly on Node.js >= 4.5.0 This usecase doesn't need zero-filling, as is properly filled with the parent buffer. This behaves exactly the same as Buffer(number) on 4.x and 6.x, and slightly faster that Buffer(number) on 8.x and above, as doesn't perform zero-fill. Older Node.js versions (<4.5.0) use the old code path. Refs: https://nodejs.org/api/deprecations.html#deprecations_dep0005_buffer_constructor
- Loading branch information