Skip to content

Commit face961

Browse files
author
MarcoFalke
committed
refactor: Use only one temporary buffer in CreateObfuscateKey
1 parent fa05ddd commit face961

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/dbwrapper.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,9 @@ const unsigned int CDBWrapper::OBFUSCATE_KEY_NUM_BYTES = 8;
220220
*/
221221
std::vector<unsigned char> CDBWrapper::CreateObfuscateKey() const
222222
{
223-
unsigned char buff[OBFUSCATE_KEY_NUM_BYTES];
224-
GetRandBytes(buff, OBFUSCATE_KEY_NUM_BYTES);
225-
return std::vector<unsigned char>(&buff[0], &buff[OBFUSCATE_KEY_NUM_BYTES]);
226-
223+
std::vector<uint8_t> ret(OBFUSCATE_KEY_NUM_BYTES);
224+
GetRandBytes(ret.data(), OBFUSCATE_KEY_NUM_BYTES);
225+
return ret;
227226
}
228227

229228
bool CDBWrapper::IsEmpty()

0 commit comments

Comments
 (0)