mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
celldb in-memory mode (--celldb-in-memory option)
This commit is contained in:
parent
420029b056
commit
1723562748
48 changed files with 1966 additions and 201 deletions
|
@ -74,13 +74,17 @@ struct CellHash {
|
|||
};
|
||||
} // namespace vm
|
||||
|
||||
inline size_t cell_hash_slice_hash(td::Slice hash) {
|
||||
// use offset 8, because in db keys are grouped by first bytes.
|
||||
return td::as<size_t>(hash.ubegin() + 8);
|
||||
}
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<vm::CellHash> {
|
||||
typedef vm::CellHash argument_type;
|
||||
typedef std::size_t result_type;
|
||||
result_type operator()(argument_type const& s) const noexcept {
|
||||
return td::as<size_t>(s.as_slice().ubegin());
|
||||
return cell_hash_slice_hash(s.as_slice());
|
||||
}
|
||||
};
|
||||
} // namespace std
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue