mirror of
https://github.com/monero-project/monero.git
synced 2026-07-28 14:47:15 -07:00
blockchain_db: remove unused MDB_val_copy specializations
The MDB_val_copy<cryptonote::blobdata> and MDB_val_copy<const char*> specializations have no references anywhere in the tree (src/, contrib/, tests/); the full build still links cleanly. They were real helpers that copied block/tx blobs and the "version" key into LMDB from 2015 (3fcb8daf6/f7e99047e). All instantiations were removed in99fbe1008(2018, "db_lmdb: save some string copies for readonly db keys/ values"), which writes blobs directly and points readonly MDB_vals at string literals (zero-copy). Every remaining MDB_val_copy<> call site uses the uint64_t/uint32_t/uint8_t primary template; these two specializations have sat unused since.
This commit is contained in:
@@ -106,36 +106,6 @@ private:
|
||||
T t_copy;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct MDB_val_copy<cryptonote::blobdata>: public MDB_val
|
||||
{
|
||||
MDB_val_copy(const cryptonote::blobdata &bd) :
|
||||
data(new char[bd.size()])
|
||||
{
|
||||
memcpy(data.get(), bd.data(), bd.size());
|
||||
mv_size = bd.size();
|
||||
mv_data = data.get();
|
||||
}
|
||||
private:
|
||||
std::unique_ptr<char[]> data;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct MDB_val_copy<const char*>: public MDB_val
|
||||
{
|
||||
MDB_val_copy(const char *s):
|
||||
size(strlen(s)+1), // include the NUL, makes it easier for compares
|
||||
data(new char[size])
|
||||
{
|
||||
mv_size = size;
|
||||
mv_data = data.get();
|
||||
memcpy(mv_data, s, size);
|
||||
}
|
||||
private:
|
||||
size_t size;
|
||||
std::unique_ptr<char[]> data;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace cryptonote
|
||||
|
||||
Reference in New Issue
Block a user