From b35b6c4449976cc9a02e2d790704279d6c2bcdfd Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 26 May 2020 21:07:42 +0400 Subject: [PATCH] Fix saving cache from InMemoryLocation. --- Telegram/SourceFiles/data/data_cloud_file.cpp | 4 ++-- Telegram/SourceFiles/ui/image/image_location.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/data/data_cloud_file.cpp b/Telegram/SourceFiles/data/data_cloud_file.cpp index d1098f38c..e8e8801d5 100644 --- a/Telegram/SourceFiles/data/data_cloud_file.cpp +++ b/Telegram/SourceFiles/data/data_cloud_file.cpp @@ -31,7 +31,7 @@ void UpdateCloudFile( if (!update) { return; } - const auto cacheBytes = !data.bytes.isEmpty() + auto cacheBytes = !data.bytes.isEmpty() ? data.bytes : file.location.file().data.is() ? file.location.file().data.get_unchecked().bytes @@ -41,7 +41,7 @@ void UpdateCloudFile( cache.putIfEmpty( cacheKey, Storage::Cache::Database::TaggedValue( - base::duplicate(data.bytes), + std::move(cacheBytes), Data::kImageCacheTag)); } } diff --git a/Telegram/SourceFiles/ui/image/image_location.h b/Telegram/SourceFiles/ui/image/image_location.h index dd57520d3..a0421c684 100644 --- a/Telegram/SourceFiles/ui/image/image_location.h +++ b/Telegram/SourceFiles/ui/image/image_location.h @@ -378,8 +378,6 @@ struct PlainUrlLocation { }; struct InMemoryLocation { - ~InMemoryLocation() = default; - QByteArray bytes; friend inline bool operator==(