diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-05-26 23:34:51 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-05-29 20:28:38 +0300 |
commit | 5026db142ab5d07c7144dfb272512d3388476a77 (patch) | |
tree | bfe8ca1908b0b94aae498b33ecd3174c7033b2f4 /src/util.h | |
parent | 7329c8fe52eb36a238dfdcdd83b8f81034d983fa (diff) |
src: use ArrayBufferViewContents more frequently
Using `ArrayBufferViewContents` over
`Buffer::Data()`/`Buffer::Length()` or `SPREAD_BUFFER_ARG` has the
advantages of creating fewer individual variables to keep track off,
not being a “magic” macro that creates variables, reducing code size,
and being faster when receiving on-heap TypedArrays.
PR-URL: https://github.com/nodejs/node/pull/27920
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index b7a2d28b669..a94e88f232f 100644 --- a/src/util.h +++ b/src/util.h @@ -446,6 +446,7 @@ class ArrayBufferViewContents { ArrayBufferViewContents() = default; explicit inline ArrayBufferViewContents(v8::Local<v8::Value> value); + explicit inline ArrayBufferViewContents(v8::Local<v8::Object> value); explicit inline ArrayBufferViewContents(v8::Local<v8::ArrayBufferView> abv); inline void Read(v8::Local<v8::ArrayBufferView> abv); |