Inline full_type to FullRemoteFileLocation::store to minimize misusage probability.
GitOrigin-RevId: 48c147f10c36a00926aa976b5272992ac1ead277
This commit is contained in:
parent
edd3bb94a4
commit
df15f8a8db
@ -250,16 +250,6 @@ class FullRemoteFileLocation {
|
||||
}
|
||||
return type;
|
||||
}
|
||||
int32 full_type() const {
|
||||
auto type = static_cast<int32>(file_type_);
|
||||
if (is_web()) {
|
||||
type |= WEB_LOCATION_FLAG;
|
||||
}
|
||||
if (!file_reference_.empty()) {
|
||||
type |= FILE_REFERENCE_FLAG;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
void check_file_reference() {
|
||||
if (file_reference_ == FileReferenceView::invalid_file_reference()) {
|
||||
|
@ -114,9 +114,14 @@ void CommonRemoteFileLocation::AsKey::store(StorerT &storer) const {
|
||||
template <class StorerT>
|
||||
void FullRemoteFileLocation::store(StorerT &storer) const {
|
||||
using ::td::store;
|
||||
store(full_type(), storer);
|
||||
bool has_file_reference = !file_reference_.empty();
|
||||
auto type = key_type();
|
||||
if (has_file_reference) {
|
||||
type |= FILE_REFERENCE_FLAG;
|
||||
}
|
||||
store(type, storer);
|
||||
store(dc_id_.get_value(), storer);
|
||||
if (!file_reference_.empty()) {
|
||||
if (has_file_reference) {
|
||||
store(file_reference_, storer);
|
||||
}
|
||||
variant_.visit([&](auto &&value) {
|
||||
|
Loading…
Reference in New Issue
Block a user