src: remove CopyBuffer

CopyBuffer was used by the PBKDF2 implementation prior to the big
refactor, which removed those call sites.

PR-URL: https://github.com/nodejs/node/pull/43463
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Tobias Nießen authored and Michaël Zasso committed 2022-07-12 07:41:34 +02:00
1 parent 0659d5e3b0
commit 4e0afa4133
1 file changed
-14
-14
View File
@@ -777,20 +777,6 @@ class ArrayBufferOrViewContents {
std::shared_ptr<v8::BackingStore> store_;
};
template <typename T>
std::vector<T> CopyBuffer(const ArrayBufferOrViewContents<T>& buf) {
std::vector<T> vec;
vec->resize(buf.size());
if (vec->size() > 0 && buf.data() != nullptr)
memcpy(vec->data(), buf.data(), vec->size());
return vec;
}
template <typename T>
std::vector<T> CopyBuffer(v8::Local<v8::Value> buf) {
return CopyBuffer(ArrayBufferOrViewContents<T>(buf));
}
v8::MaybeLocal<v8::Value> EncodeBignum(
Environment* env,
const BIGNUM* bn,