Fix saving cache from InMemoryLocation.

This commit is contained in:
John Preston 2020-05-26 21:07:42 +04:00
parent 74ef8104a7
commit b35b6c4449
2 changed files with 2 additions and 4 deletions

View file

@ -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<InMemoryLocation>()
? file.location.file().data.get_unchecked<InMemoryLocation>().bytes
@ -41,7 +41,7 @@ void UpdateCloudFile(
cache.putIfEmpty(
cacheKey,
Storage::Cache::Database::TaggedValue(
base::duplicate(data.bytes),
std::move(cacheBytes),
Data::kImageCacheTag));
}
}

View file

@ -378,8 +378,6 @@ struct PlainUrlLocation {
};
struct InMemoryLocation {
~InMemoryLocation() = default;
QByteArray bytes;
friend inline bool operator==(