Remove unused return value in FileManager::merge.
This commit is contained in:
parent
b29fc78f85
commit
348ee9a95b
@ -1323,10 +1323,7 @@ Result<FileId> FileManager::register_file(FileData &&data, FileLocationSource fi
|
|||||||
}
|
}
|
||||||
Status status;
|
Status status;
|
||||||
if (merge_file_id.is_valid()) {
|
if (merge_file_id.is_valid()) {
|
||||||
auto r_file_id = merge(file_id, merge_file_id);
|
status = merge(file_id, merge_file_id);
|
||||||
if (r_file_id.is_error()) {
|
|
||||||
status = r_file_id.move_as_error();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try_flush_node(get_file_node(file_id), "register_file");
|
try_flush_node(get_file_node(file_id), "register_file");
|
||||||
@ -1515,7 +1512,7 @@ void FileManager::do_cancel_generate(FileNodePtr node) {
|
|||||||
node->set_generate_priority(0, 0);
|
node->set_generate_priority(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sync) {
|
Status FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sync) {
|
||||||
if (!x_file_id.is_valid()) {
|
if (!x_file_id.is_valid()) {
|
||||||
return Status::Error("First file_id is invalid");
|
return Status::Error("First file_id is invalid");
|
||||||
}
|
}
|
||||||
@ -1527,7 +1524,7 @@ Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sy
|
|||||||
|
|
||||||
if (!y_file_id.is_valid()) {
|
if (!y_file_id.is_valid()) {
|
||||||
LOG(DEBUG) << "Old file is invalid";
|
LOG(DEBUG) << "Old file is invalid";
|
||||||
return x_node->main_file_id_;
|
return Status::OK();
|
||||||
}
|
}
|
||||||
FileNodePtr y_node = get_file_node(y_file_id);
|
FileNodePtr y_node = get_file_node(y_file_id);
|
||||||
if (!y_node) {
|
if (!y_node) {
|
||||||
@ -1542,7 +1539,7 @@ Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sy
|
|||||||
if (x_file_id != y_file_id) {
|
if (x_file_id != y_file_id) {
|
||||||
LOG(DEBUG) << "New file " << x_file_id << " and old file " << y_file_id << " are already merged";
|
LOG(DEBUG) << "New file " << x_file_id << " and old file " << y_file_id << " are already merged";
|
||||||
}
|
}
|
||||||
return x_node->main_file_id_;
|
return Status::OK();
|
||||||
}
|
}
|
||||||
if (y_file_id == y_node->upload_pause_) {
|
if (y_file_id == y_node->upload_pause_) {
|
||||||
y_node->set_upload_pause(FileId());
|
y_node->set_upload_pause(FileId());
|
||||||
@ -1786,7 +1783,7 @@ Result<FileId> FileManager::merge(FileId x_file_id, FileId y_file_id, bool no_sy
|
|||||||
}
|
}
|
||||||
try_flush_node_full(node, node_i != remote_i, node_i != local_i, node_i != generate_i, other_pmc_id);
|
try_flush_node_full(node, node_i != remote_i, node_i != local_i, node_i != generate_i, other_pmc_id);
|
||||||
|
|
||||||
return node->main_file_id_;
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileManager::add_file_source(FileId file_id, FileSourceId file_source_id) {
|
void FileManager::add_file_source(FileId file_id, FileSourceId file_source_id) {
|
||||||
@ -2046,8 +2043,7 @@ void FileManager::load_from_pmc(FileNodePtr node, bool new_remote, bool new_loca
|
|||||||
TRY_RESULT(file_data, file_db_->get_file_data_sync(location));
|
TRY_RESULT(file_data, file_db_->get_file_data_sync(location));
|
||||||
TRY_RESULT(new_file_id,
|
TRY_RESULT(new_file_id,
|
||||||
register_file(std::move(file_data), FileLocationSource::FromDatabase, FileId(), source, false));
|
register_file(std::move(file_data), FileLocationSource::FromDatabase, FileId(), source, false));
|
||||||
TRY_RESULT(main_file_id, merge(file_id, new_file_id)); // merge manually to keep merge parameters order
|
TRY_STATUS(merge(file_id, new_file_id)); // merge manually to keep merge parameters order
|
||||||
file_id = main_file_id;
|
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
};
|
};
|
||||||
if (new_remote) {
|
if (new_remote) {
|
||||||
|
@ -436,7 +436,7 @@ class FileManager final : public FileLoadManager::Callback {
|
|||||||
string conversion, DialogId owner_dialog_id,
|
string conversion, DialogId owner_dialog_id,
|
||||||
int64 expected_size) TD_WARN_UNUSED_RESULT;
|
int64 expected_size) TD_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
Result<FileId> merge(FileId x_file_id, FileId y_file_id, bool no_sync = false) TD_WARN_UNUSED_RESULT;
|
Status merge(FileId x_file_id, FileId y_file_id, bool no_sync = false);
|
||||||
|
|
||||||
void add_file_source(FileId file_id, FileSourceId file_source_id);
|
void add_file_source(FileId file_id, FileSourceId file_source_id);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user