diff options
author | Tobias Nießen <tniessen@tnie.de> | 2022-09-14 23:44:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 21:44:31 +0000 |
commit | c6773bc3e6b5aca8473cef5b2b6a08d2ae4a4649 (patch) | |
tree | b00580ee6c8a07a9cbe38572b2b697e7a25ee322 /src/node_blob.h | |
parent | 9825a7e01d35b9d49ebb58efed2c316012c19db6 (diff) | |
download | node-new-c6773bc3e6b5aca8473cef5b2b6a08d2ae4a4649.tar.gz |
src: avoid copy when creating Blob
PR-URL: https://github.com/nodejs/node/pull/44616
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Diffstat (limited to 'src/node_blob.h')
-rw-r--r-- | src/node_blob.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/node_blob.h b/src/node_blob.h index 80e59a1c51..f0340f313b 100644 --- a/src/node_blob.h +++ b/src/node_blob.h @@ -45,16 +45,13 @@ class Blob : public BaseObject { static v8::Local<v8::FunctionTemplate> GetConstructorTemplate( Environment* env); - static BaseObjectPtr<Blob> Create( - Environment* env, - const std::vector<BlobEntry> store, - size_t length); + static BaseObjectPtr<Blob> Create(Environment* env, + const std::vector<BlobEntry>& store, + size_t length); static bool HasInstance(Environment* env, v8::Local<v8::Value> object); - const std::vector<BlobEntry> entries() const { - return store_; - } + const std::vector<BlobEntry>& entries() const { return store_; } void MemoryInfo(MemoryTracker* tracker) const override; SET_MEMORY_INFO_NAME(Blob) |