diff options
| author | levlam <levlam@telegram.org> | 2023-02-02 17:40:47 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2023-02-02 17:40:47 +0300 |
| commit | 0adcac246adef771d5a97c44dde6ebbcc01030ac (patch) | |
| tree | 2ae0e2e408a193dac10f5df76a2057cc5dd87fca /tddb | |
| parent | d6b7770561359019f77598525a69799b93f948b1 (diff) | |
Use explicit as_mutable_slice to get MutableSlice.
Diffstat (limited to 'tddb')
| -rw-r--r-- | tddb/td/db/binlog/Binlog.cpp | 4 | ||||
| -rw-r--r-- | tddb/td/db/binlog/BinlogEvent.cpp | 2 | ||||
| -rw-r--r-- | tddb/td/db/binlog/BinlogEvent.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tddb/td/db/binlog/Binlog.cpp b/tddb/td/db/binlog/Binlog.cpp index ddd6a723c..3ad28c8e9 100644 --- a/tddb/td/db/binlog/Binlog.cpp +++ b/tddb/td/db/binlog/Binlog.cpp @@ -581,9 +581,9 @@ Status Binlog::load_binlog(const Callback &callback, const Callback &debug_callb } void Binlog::update_encryption(Slice key, Slice iv) { - as_slice(aes_ctr_key_).copy_from(key); + as_mutable_slice(aes_ctr_key_).copy_from(key); UInt128 aes_ctr_iv; - as_slice(aes_ctr_iv).copy_from(iv); + as_mutable_slice(aes_ctr_iv).copy_from(iv); aes_ctr_state_.init(as_slice(aes_ctr_key_), as_slice(aes_ctr_iv)); } diff --git a/tddb/td/db/binlog/BinlogEvent.cpp b/tddb/td/db/binlog/BinlogEvent.cpp index 0b0801815..56926180d 100644 --- a/tddb/td/db/binlog/BinlogEvent.cpp +++ b/tddb/td/db/binlog/BinlogEvent.cpp @@ -55,7 +55,7 @@ Status BinlogEvent::validate() const { BufferSlice BinlogEvent::create_raw(uint64 id, int32 type, int32 flags, const Storer &storer) { auto raw_event = BufferSlice{storer.size() + MIN_SIZE}; - TlStorerUnsafe tl_storer(raw_event.as_slice().ubegin()); + TlStorerUnsafe tl_storer(raw_event.as_mutable_slice().ubegin()); tl_storer.store_int(narrow_cast<int32>(raw_event.size())); tl_storer.store_long(id); tl_storer.store_int(type); diff --git a/tddb/td/db/binlog/BinlogEvent.h b/tddb/td/db/binlog/BinlogEvent.h index 0127163ba..c429638a2 100644 --- a/tddb/td/db/binlog/BinlogEvent.h +++ b/tddb/td/db/binlog/BinlogEvent.h @@ -100,7 +100,7 @@ struct BinlogEvent { static BufferSlice create_raw(uint64 id, int32 type, int32 flags, const Storer &storer); - std::string public_to_string() const { + string public_to_string() const { return PSTRING() << "LogEvent[" << tag("id", format::as_hex(id_)) << tag("type", type_) << tag("flags", flags_) << tag("data", get_data().size()) << "]" << debug_info_; } |
