Review fixes.

This commit is contained in:
Maxim Pimenov 2019-07-17 14:47:45 +03:00 committed by Tatiana Yan
parent d79c10358d
commit fb5fc142bc
2 changed files with 6 additions and 9 deletions

View file

@ -12,7 +12,6 @@
#include "base/assert.hpp"
#include "base/checked_cast.hpp"
#include "base/logging.hpp"
#include "base/macros.hpp"
#if defined(__clang__)
#pragma clang diagnostic push
@ -212,8 +211,7 @@ public:
auto const j = static_cast<uint32_t>(m_ids.select(i));
Value value;
bool const ok = Get(j, value);
UNUSED_VALUE(ok);
ASSERT(ok, ());
CHECK(ok, ());
fn(j, value);
}
}

View file

@ -110,7 +110,6 @@ public:
static Version const kLatestVersion;
static size_t const kMagicAndVersionSize;
static size_t const kHeaderOffset;
static std::array<base::GeoObjectId::Type, 3> kTypes;
struct HeaderV0
{
@ -219,9 +218,9 @@ public:
{
using Type = base::GeoObjectId::Type;
auto const startPos = base::checked_cast<uint32_t>(sink.Pos());
SerializeV0(sink, Type::OsmNode, header.m_nodesOffset, map);
SerializeV0(sink, Type::OsmWay, header.m_waysOffset, map);
SerializeV0(sink, Type::OsmRelation, header.m_relationsOffset, map);
SerializeV0(sink, Type::OsmNode, map, header.m_nodesOffset);
SerializeV0(sink, Type::OsmWay, map, header.m_waysOffset);
SerializeV0(sink, Type::OsmRelation, map, header.m_relationsOffset);
header.m_numEntries = static_cast<uint32_t>(map.Size());
@ -232,8 +231,8 @@ public:
}
template <typename Sink>
static void SerializeV0(Sink & sink, base::GeoObjectId::Type type, uint32_t & offset,
FeatureIdToGeoObjectIdBimapMem const & map)
static void SerializeV0(Sink & sink, base::GeoObjectId::Type type,
FeatureIdToGeoObjectIdBimapMem const & map, uint32_t & offset)
{
offset = base::checked_cast<uint32_t>(sink.Pos());
std::vector<std::pair<uint32_t, base::GeoObjectId>> entries;