Use some unused Status responses.

GitOrigin-RevId: b49d15a22918169b5e1a212e5858dc2e9bd2033e
This commit is contained in:
levlam 2019-04-28 15:00:06 +03:00
parent 45ae774bf9
commit 16a209cef0
11 changed files with 17 additions and 21 deletions

View File

@ -95,7 +95,7 @@ class SqliteKVBench : public td::Benchmark {
td::string path = "testdb.sqlite";
td::SqliteDb::destroy(path).ignore();
if (is_encrypted) {
td::SqliteDb::change_key(path, td::DbKey::password("cucumber"), td::DbKey::empty());
td::SqliteDb::change_key(path, td::DbKey::password("cucumber"), td::DbKey::empty()).ensure();
db = td::SqliteDb::open_with_key(path, td::DbKey::password("cucumber")).move_as_ok();
} else {
db = td::SqliteDb::open_with_key(path, td::DbKey::empty()).move_as_ok();

View File

@ -85,7 +85,7 @@ Status RawConnection::flush_read(const AuthKey &auth_key, Callback &callback) {
}
if (quick_ack != 0) {
on_quick_ack(quick_ack, callback);
TRY_STATUS(on_quick_ack(quick_ack, callback));
continue;
}
@ -146,7 +146,7 @@ Status RawConnection::on_quick_ack(uint32 quick_ack, Callback &callback) {
}
auto token = it->second;
quick_ack_to_token_.erase(it);
callback.on_quick_ack(token);
callback.on_quick_ack(token).ignore();
return Status::OK();
}

View File

@ -1196,7 +1196,7 @@ void SecretChatActor::update_seq_no_state(const T &new_seq_no_state) {
return on_seq_no_state_changed();
}
Status SecretChatActor::do_inbound_message_decrypted_pending(unique_ptr<logevent::InboundSecretMessage> message) {
void SecretChatActor::do_inbound_message_decrypted_pending(unique_ptr<logevent::InboundSecretMessage> message) {
// Just save logevent if necessary
auto logevent_id = message->logevent_id();
@ -1217,8 +1217,6 @@ Status SecretChatActor::do_inbound_message_decrypted_pending(unique_ptr<logevent
auto seq_no = message->decrypted_message_layer->out_seq_no_ / 2;
pending_inbound_messages_[seq_no] = std::move(message);
return Status::OK();
}
Status SecretChatActor::do_inbound_message_decrypted(unique_ptr<logevent::InboundSecretMessage> message) {

View File

@ -550,7 +550,7 @@ class SecretChatActor : public NetQueryCallback {
Status do_inbound_message_encrypted(unique_ptr<logevent::InboundSecretMessage> message);
Status do_inbound_message_decrypted_unchecked(unique_ptr<logevent::InboundSecretMessage> message);
Status do_inbound_message_decrypted(unique_ptr<logevent::InboundSecretMessage> message);
Status do_inbound_message_decrypted_pending(unique_ptr<logevent::InboundSecretMessage> message);
void do_inbound_message_decrypted_pending(unique_ptr<logevent::InboundSecretMessage> message);
void on_inbound_save_message_finish(uint64 state_id);
void on_inbound_save_changes_finish(uint64 state_id);

View File

@ -64,10 +64,10 @@ static Status data_view_for_each(const DataView &data, F &&f) {
Result<ValueHash> calc_value_hash(const DataView &data_view) {
Sha256State state;
sha256_init(&state);
data_view_for_each(data_view, [&state](BufferSlice bytes) {
TRY_STATUS(data_view_for_each(data_view, [&state](BufferSlice bytes) {
sha256_update(bytes.as_slice(), &state);
return Status::OK();
});
}));
UInt256 res;
sha256_final(&state, as_slice(res));
return ValueHash{res};

View File

@ -3914,7 +3914,7 @@ void Td::close_impl(bool destroy_flag) {
if (state_ == State::Decrypt) {
clear_requests();
if (destroy_flag) {
TdDb::destroy(parameters_);
TdDb::destroy(parameters_).ignore();
}
state_ = State::Close;
close_flag_ = 4;

View File

@ -130,7 +130,7 @@ void Bitmask::set(int64 offset_part) {
}
int64 Bitmask::size() const {
return static_cast<int64>(data_.size() * 8);
return static_cast<int64>(data_.size()) * 8;
}
StringBuilder &operator<<(StringBuilder &sb, const Bitmask &mask) {

View File

@ -1738,13 +1738,13 @@ void FileManager::load_from_pmc(FileNodePtr node, bool new_remote, bool new_loca
return Status::OK();
};
if (new_remote) {
load(remote);
load(remote).ignore();
}
if (new_local) {
load(local);
load(local).ignore();
}
if (new_generate) {
load(generate);
load(generate).ignore();
}
}

View File

@ -48,7 +48,7 @@ struct DbFileInfo {
// long and blocking
template <class CallbackT>
Status scan_db(CallbackT &&callback) {
void scan_db(CallbackT &&callback) {
G()->td_db()->get_file_db_shared()->pmc().get_by_range("file0", "file:", [&](Slice key, Slice value) {
// skip reference to other data
if (value.substr(0, 2) == "@@") {
@ -84,7 +84,6 @@ Status scan_db(CallbackT &&callback) {
}
callback(info);
});
return Status::OK();
}
struct FsFileInfo {
@ -97,7 +96,7 @@ struct FsFileInfo {
// long and blocking
template <class CallbackT>
Status scan_fs(CallbackT &&callback) {
void scan_fs(CallbackT &&callback) {
for (int32 i = 0; i < file_type_size; i++) {
auto file_type = static_cast<FileType>(i);
if (file_type == FileType::SecureRaw) {
@ -131,7 +130,6 @@ Status scan_fs(CallbackT &&callback) {
})
.ignore();
}
return Status::OK();
}
} // namespace

View File

@ -215,8 +215,8 @@ string PartsManager::get_bitmask() {
}
bool PartsManager::is_part_in_streaming_limit(int part_i) const {
auto offset_begin = static_cast<int64>(part_i * get_part_size());
auto offset_end = static_cast<int64>(offset_begin + get_part(part_i).size);
auto offset_begin = static_cast<int64>(part_i) * static_cast<int64>(get_part_size());
auto offset_end = offset_begin + static_cast<int64>(get_part(part_i).size);
if (offset_begin >= get_expected_size()) {
return false;

View File

@ -252,7 +252,7 @@ void NetQueryDispatcher::update_mtproto_header() {
}
void NetQueryDispatcher::update_valid_dc(DcId dc_id) {
wait_dc_init(dc_id, true);
wait_dc_init(dc_id, true).ignore();
}
bool NetQueryDispatcher::is_dc_inited(int32 raw_dc_id) {