From 4e0afa4133216193efa04b8eef31beb290e7a843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Mon, 20 Jun 2022 09:51:04 +0200 Subject: [PATCH] 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 Reviewed-By: Antoine du Hamel Reviewed-By: Mohammed Keyvanzadeh Reviewed-By: Luigi Pinca Reviewed-By: Darshan Sen --- src/crypto/crypto_util.h | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/crypto/crypto_util.h b/src/crypto/crypto_util.h index e5d9410039cad1..c0b10583ce0978 100644 --- a/src/crypto/crypto_util.h +++ b/src/crypto/crypto_util.h @@ -777,20 +777,6 @@ class ArrayBufferOrViewContents { std::shared_ptr store_; }; -template -std::vector CopyBuffer(const ArrayBufferOrViewContents& buf) { - std::vector vec; - vec->resize(buf.size()); - if (vec->size() > 0 && buf.data() != nullptr) - memcpy(vec->data(), buf.data(), vec->size()); - return vec; -} - -template -std::vector CopyBuffer(v8::Local buf) { - return CopyBuffer(ArrayBufferOrViewContents(buf)); -} - v8::MaybeLocal EncodeBignum( Environment* env, const BIGNUM* bn,