Keep uninitialized data

This commit is contained in:
Andrea Cavalli 2020-10-22 19:07:36 +02:00
parent 184510fc66
commit 11332192a0
2 changed files with 5 additions and 5 deletions

View File

@ -14545,7 +14545,7 @@ void ContactsManager::memory_cleanup() {
//auto &user = it->second;
auto user_id = it->first;
auto is_invalid = time - user_id.get_time() > user_ttl || user_id.get_time() > time;
auto is_invalid = time - user_id.get_time() > user_ttl;
if (is_invalid) {
user_id.reset_time();
@ -14578,7 +14578,7 @@ void ContactsManager::memory_cleanup() {
//auto &chat = it->second;
auto chat_id = it->first;
auto is_invalid = time - chat_id.get_time() > chat_ttl || chat_id.get_time() > time;
auto is_invalid = time - chat_id.get_time() > chat_ttl;
if (is_invalid) {
chat_id.reset_time();
@ -14606,7 +14606,7 @@ void ContactsManager::memory_cleanup() {
//auto &channel = it->second;
auto channel_id = it->first;
auto is_invalid = time - channel_id.get_time() > chat_ttl || channel_id.get_time() > time;
auto is_invalid = time - channel_id.get_time() > chat_ttl;
if (is_invalid) {
channel_id.reset_time();

View File

@ -3882,7 +3882,7 @@ void FileManager::memory_cleanup() {
if (find_node != file_nodes_.end()) {
auto &node = find_node->second;
if (time - node->main_file_id_.get_time() > file_ttl || node->main_file_id_.get_time() > time) {
if (time - node->main_file_id_.get_time() > file_ttl) {
auto can_reset = node->download_priority_ == 0;
can_reset &= node->generate_download_priority_ == 0;
can_reset &= node->download_id_ == 0;
@ -3895,7 +3895,7 @@ void FileManager::memory_cleanup() {
if (find_file != file_id_info_.end()) {
auto &file = find_file->second;
can_reset &= file.download_priority_ == 0;
can_reset &= time - file_ids_it->get_time() > file_ttl || file_ids_it->get_time() > time;
can_reset &= time - file_ids_it->get_time() > file_ttl;
}
file_ids_it++;
}