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

View file

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