diff --git a/src/mongo/crypto/fle_tokens.cpp b/src/mongo/crypto/fle_tokens.cpp index d6a09e660cb..afd9bd9c82a 100644 --- a/src/mongo/crypto/fle_tokens.cpp +++ b/src/mongo/crypto/fle_tokens.cpp @@ -47,13 +47,13 @@ typedef _mongocrypt_crypto_t mongocrypt_crypto_t; namespace mongo { -auto kEmptyPrfBlock = MongoCryptBuffer::copy(ConstDataRange(PrfBlock{})); +const auto kEmptyPrfBlock = MongoCryptBuffer::copy(ConstDataRange(PrfBlock{})); #define FLE_TOKEN_TYPE_MC(TokenType) mc_##TokenType##_t // Variadic arguments represent parameters for the token's ::deriveFrom function. #define FLE_TOKEN_CLASS_IMPL_BEGIN(TokenType, ...) \ - void TokenType::initializeFromBuffer(MongoCryptBuffer buffer) { \ + void TokenType::initializeFromBuffer(const MongoCryptBuffer& buffer) { \ _token = mc_##TokenType##_new_from_buffer_copy(buffer.get()); \ } \ \ diff --git a/src/mongo/crypto/fle_tokens.h b/src/mongo/crypto/fle_tokens.h index 0e0904188db..c303c32a728 100644 --- a/src/mongo/crypto/fle_tokens.h +++ b/src/mongo/crypto/fle_tokens.h @@ -158,7 +158,7 @@ public: private: \ FLE_TOKEN_TYPE_MC(TokenType) * _token; \ \ - void initializeFromBuffer(MongoCryptBuffer buffer); \ + void initializeFromBuffer(const MongoCryptBuffer& buffer); \ }; \ }