forked from organicmaps/organicmaps
[indexer] Remove unused code.
This commit is contained in:
parent
a50fb7a772
commit
87ca9aa8f2
3 changed files with 6 additions and 40 deletions
|
@ -43,8 +43,8 @@ AltitudeLoader::AltitudeLoader(DataSource const & dataSource, MwmSet::MwmId cons
|
|||
|
||||
m_countryFileName = mwmValue.GetCountryFileName();
|
||||
|
||||
if (mwmValue.GetHeader().GetFormat() < version::Format::v8)
|
||||
return;
|
||||
CHECK_GREATER_OR_EQUAL(mwmValue.GetHeader().GetFormat(), version::Format::v8,
|
||||
("Unsupported mwm format"));
|
||||
|
||||
if (!mwmValue.m_cont.IsExist(ALTITUDES_FILE_TAG))
|
||||
return;
|
||||
|
@ -75,7 +75,7 @@ geometry::Altitudes const & AltitudeLoader::GetAltitudes(uint32_t featureId, siz
|
|||
{
|
||||
if (!HasAltitudes())
|
||||
{
|
||||
// The version of mwm is less than version::Format::v8 or there's no altitude section in mwm.
|
||||
// There's no altitude section in mwm.
|
||||
return m_cache
|
||||
.insert(
|
||||
make_pair(featureId, geometry::Altitudes(pointCount, geometry::kDefaultAltitudeMeters)))
|
||||
|
|
|
@ -550,10 +550,9 @@ void FeatureType::ParseMetadata()
|
|||
{
|
||||
ReaderSource<FilesContainerR::TReader> src(m_loadInfo->GetMetadataReader());
|
||||
src.Skip(it->value);
|
||||
if (m_loadInfo->GetMWMFormat() >= version::Format::v8)
|
||||
m_metadata.Deserialize(src);
|
||||
else
|
||||
m_metadata.DeserializeFromMWMv7OrLower(src);
|
||||
CHECK_GREATER_OR_EQUAL(m_loadInfo->GetMWMFormat(), version::Format::v8,
|
||||
("Unsupported mwm format"));
|
||||
m_metadata.Deserialize(src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,39 +161,6 @@ public:
|
|||
void Set(EType type, std::string const & value) { MetadataBase::Set(static_cast<uint8_t>(type), value); }
|
||||
void Drop(EType type) { Set(type, std::string()); }
|
||||
std::string GetWikiURL() const;
|
||||
|
||||
// TODO: Commented code below is now longer neded, but I leave it here
|
||||
// as a hint to what is going on in DeserializeFromMWMv7OrLower.
|
||||
// Please, remove it when DeserializeFromMWMv7OrLower is no longer neded.
|
||||
// template <class TWriter>
|
||||
// void SerializeToMWM(TWriter & writer) const
|
||||
// {
|
||||
// for (auto const & e : m_metadata)
|
||||
// {
|
||||
// // Set high bit if it's the last element.
|
||||
// uint8_t const mark = (&e == &(*m_metadata.crbegin()) ? 0x80 : 0);
|
||||
// uint8_t elem[2] = {static_cast<uint8_t>(e.first | mark),
|
||||
// static_cast<uint8_t>(min(e.second.size(), (size_t)kMaxStringLength))};
|
||||
// writer.Write(elem, sizeof(elem));
|
||||
// writer.Write(e.second.data(), elem[1]);
|
||||
// }
|
||||
// }
|
||||
|
||||
template <class TSource>
|
||||
void DeserializeFromMWMv7OrLower(TSource & src)
|
||||
{
|
||||
uint8_t header[2] = {0};
|
||||
char buffer[kMaxStringLength] = {0};
|
||||
do
|
||||
{
|
||||
src.Read(header, sizeof(header));
|
||||
src.Read(buffer, header[1]);
|
||||
m_metadata[header[0] & 0x7F].assign(buffer, header[1]);
|
||||
} while (!(header[0] & 0x80));
|
||||
}
|
||||
|
||||
private:
|
||||
enum { kMaxStringLength = 255 };
|
||||
};
|
||||
|
||||
class AddressData : public MetadataBase
|
||||
|
|
Loading…
Add table
Reference in a new issue