forked from organicmaps/organicmaps
Reveiw fixes.
This commit is contained in:
parent
3b8b50a68c
commit
468f6a563b
2 changed files with 9 additions and 6 deletions
|
@ -87,10 +87,11 @@ TAltitudes const & AltitudeLoader::GetAltitudes(uint32_t featureId, size_t point
|
|||
Altitudes altitudes;
|
||||
ReaderSource<FilesContainerR::TReader> src(*m_reader);
|
||||
src.Skip(altitudeInfoOffsetInSection);
|
||||
altitudes.Deserialize(m_header.m_minAltitude, pointCount, src);
|
||||
bool const isDeserialized = altitudes.Deserialize(m_header.m_minAltitude, pointCount, src);
|
||||
|
||||
bool const allValid = none_of(altitudes.m_altitudes.begin(), altitudes.m_altitudes.end(),
|
||||
[](TAltitude a) { return a == kInvalidAltitude; });
|
||||
bool const allValid = isDeserialized
|
||||
&& none_of(altitudes.m_altitudes.begin(), altitudes.m_altitudes.end(),
|
||||
[](TAltitude a) { return a == kInvalidAltitude; });
|
||||
if (!allValid)
|
||||
{
|
||||
ASSERT(false, (altitudes.m_altitudes));
|
||||
|
|
|
@ -22,6 +22,7 @@ struct AltitudeHeader
|
|||
using TAltitudeSectionVersion = uint16_t;
|
||||
|
||||
AltitudeHeader() { Reset(); }
|
||||
|
||||
template <class TSink>
|
||||
void Serialize(TSink & sink) const
|
||||
{
|
||||
|
@ -91,13 +92,13 @@ public:
|
|||
}
|
||||
|
||||
template <class TSource>
|
||||
void Deserialize(TAltitude minAltitude, size_t pointCount, TSource & src)
|
||||
bool Deserialize(TAltitude minAltitude, size_t pointCount, TSource & src)
|
||||
{
|
||||
m_altitudes.clear();
|
||||
if (pointCount == 0)
|
||||
{
|
||||
ASSERT(false, ());
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_altitudes.resize(pointCount);
|
||||
|
@ -109,10 +110,11 @@ public:
|
|||
{
|
||||
ASSERT(false, ());
|
||||
m_altitudes.clear();
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
prevAltitude = m_altitudes[i];
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// \note |m_altitudes| is a vector of feature point altitudes. There's two possibilities:
|
||||
|
|
Loading…
Add table
Reference in a new issue