1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-02-12 11:12:16 +00:00

Fix typo in variable name (#940)

This commit is contained in:
iliavy 2024-03-26 14:54:20 +03:00 committed by GitHub
parent 0bcebe8a0e
commit 43ad9947b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -324,7 +324,7 @@ td::Status Torrent::add_piece(td::uint64 piece_i, td::Slice data, td::Ref<vm::Ce
piece_is_ready_[piece_i] = true;
ready_parts_count_++;
if (chunks_.empty() || !enabled_wirte_to_files_) {
if (chunks_.empty() || !enabled_write_to_files_) {
return add_pending_piece(piece_i, data);
}
return add_validated_piece(piece_i, data);
@ -357,7 +357,7 @@ td::Status Torrent::add_pending_piece(td::uint64 piece_i, td::Slice data) {
fatal_error_ = S.clone();
return S;
}
if (enabled_wirte_to_files_) {
if (enabled_write_to_files_) {
add_pending_pieces();
}
}
@ -367,10 +367,10 @@ td::Status Torrent::add_pending_piece(td::uint64 piece_i, td::Slice data) {
}
void Torrent::enable_write_to_files() {
if (enabled_wirte_to_files_) {
if (enabled_write_to_files_) {
return;
}
enabled_wirte_to_files_ = true;
enabled_write_to_files_ = true;
if (header_) {
add_pending_pieces();
}
@ -441,7 +441,7 @@ td::Status Torrent::add_validated_piece(td::uint64 piece_i, td::Slice data) {
}
bool Torrent::is_completed() const {
return inited_info_ && enabled_wirte_to_files_ && included_ready_size_ == included_size_;
return inited_info_ && enabled_write_to_files_ && included_ready_size_ == included_size_;
}
td::Result<td::BufferSlice> Torrent::read_file(td::Slice name) {
@ -488,7 +488,7 @@ Torrent::Torrent(Info info, td::optional<TorrentHeader> header, ton::MerkleTree
, info_(info)
, root_dir_(std::move(root_dir))
, header_(std::move(header))
, enabled_wirte_to_files_(true)
, enabled_write_to_files_(true)
, merkle_tree_(std::move(tree))
, piece_is_ready_(info_.pieces_count(), true)
, ready_parts_count_{info_.pieces_count()}
@ -586,7 +586,7 @@ void Torrent::set_file_excluded(size_t i, bool excluded) {
included_ready_size_ += chunk.ready_size;
}
chunk.excluded = excluded;
if (!enabled_wirte_to_files_ || excluded) {
if (!enabled_write_to_files_ || excluded) {
return;
}
auto range = get_file_parts_range(i);

View file

@ -173,7 +173,7 @@ class Torrent {
size_t not_ready_pending_piece_count_{0};
size_t header_pieces_count_{0};
std::map<td::uint64, td::string> pending_pieces_;
bool enabled_wirte_to_files_ = false;
bool enabled_write_to_files_ = false;
struct InMemoryPiece {
std::string data;
std::set<size_t> pending_chunks;