0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/lib
alejandro 51587b2202 buffer: preallocate array with buffer length
Because the final array length is known, it's better to allocate its
final length at initialization time to avoid future reallocations.

Also add an explicit buffer length greater than 0 comparison so
it's more readable, avoids the internal ToBoolean call and follows the
standard Node.js API format (as it can be checked in other similar
structures where 'length > 0' is preferred over 'length')

PR-URL: https://github.com/nodejs/node/pull/11733
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2017-04-05 18:36:09 -07:00
..
internal url: avoid instanceof for WHATWG URL 2017-04-04 17:36:37 -07:00
_debug_agent.js lib: remove unused msg parameter in debug_agent 2017-03-15 17:03:02 +01:00
_debugger.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_http_agent.js http: use more efficient module.exports pattern 2017-03-20 16:01:31 -07:00
_http_client.js http: should support userland Agent 2017-03-26 13:13:58 -07:00
_http_common.js http: avoid retaining unneeded memory 2017-03-22 10:26:02 -07:00
_http_incoming.js tools: ignore URLs in line length linting 2017-03-20 18:28:40 -07:00
_http_outgoing.js lib: use Object.create(null) directly 2017-03-24 15:25:49 -07:00
_http_server.js http: avoid retaining unneeded memory 2017-03-22 10:26:02 -07:00
_stream_duplex.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_stream_passthrough.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_stream_readable.js stream: avoid using forEach 2017-03-17 11:09:10 -07:00
_stream_transform.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_stream_wrap.js stream: avoid using forEach 2017-03-17 11:09:10 -07:00
_stream_writable.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_tls_common.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_tls_legacy.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
_tls_wrap.js Partial revert "tls: keep track of stream that is closed" 2017-03-27 02:21:39 +02:00
.eslintrc.yaml tools: rename eslintrc to an undeprecated format 2017-01-18 09:48:52 +05:30
assert.js assert: add support for Map and Set in deepEqual 2017-04-03 10:15:53 +02:00
buffer.js buffer: preallocate array with buffer length 2017-04-05 18:36:09 -07:00
child_process.js child_process: improve killSignal validations 2017-04-04 13:02:51 +05:30
cluster.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
console.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
constants.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
crypto.js crypto: add sign/verify support for RSASSA-PSS 2017-04-01 13:27:52 +02:00
dgram.js dgram: support Uint8Array input to send() 2017-03-27 02:03:51 +02:00
dns.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
domain.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
events.js events: do not keep arrays with a single listener 2017-04-04 10:36:39 -07:00
fs.js lib: use Object.create(null) directly 2017-03-24 15:25:49 -07:00
http.js http: use more efficient module.exports pattern 2017-03-20 16:01:31 -07:00
https.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
module.js inspector: use inspector API for "break on start" 2017-03-30 13:25:05 -07:00
net.js net: rename internal functions for readability 2017-04-02 01:38:24 +08:00
os.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
path.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
process.js
punycode.js
querystring.js lib: use Object.create(null) directly 2017-03-24 15:25:49 -07:00
readline.js readline: rename deDupeHistory option 2017-03-22 08:56:24 -07:00
repl.js repl: avoid using forEach 2017-03-17 11:09:40 -07:00
stream.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
string_decoder.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
sys.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
timers.js timers: fix not to close reused timer handle 2017-03-22 10:47:52 -07:00
tls.js tls: support Uint8Arrays for protocol list buffers 2017-03-27 02:08:49 +02:00
tty.js tty: remove NODE_TTY_UNSAFE_ASYNC 2017-03-31 22:02:25 +02:00
url.js url: name anonymous functions in url 2017-03-26 12:40:24 +02:00
util.js util: show External values explicitly in inspect 2017-04-03 10:08:26 +02:00
v8.js v8: fix offsets for TypedArray deserialization 2017-04-03 10:38:10 +02:00
vm.js meta: restore original copyright header 2017-03-10 11:23:48 -08:00
zlib.js zlib: support Uint8Array in convenience methods 2017-04-03 09:50:09 +02:00