[generator] review fixes

This commit is contained in:
Mikhail Gorbushin 2019-04-30 18:39:16 +03:00 committed by Vladimir Byko-Ianko
parent 3553e5591f
commit e887a33052
4 changed files with 8 additions and 4 deletions

View file

@ -94,7 +94,7 @@ bool RestrictionCollector::ParseRestrictions(string const & path)
return false;
Restriction::Type restrictionType;
auto viaType = RestrictionWriter::ViaType::Max;
auto viaType = RestrictionWriter::ViaType::Count;
FromString(*iter, restrictionType);
++iter;
@ -120,7 +120,7 @@ bool RestrictionCollector::ParseRestrictions(string const & path)
if (viaType == RestrictionWriter::ViaType::Node)
CHECK_EQUAL(osmIds.size(), 2, ("Only |from| and |to| osmId."));
CHECK_NOT_EQUAL(viaType, RestrictionWriter::ViaType::Max, ());
CHECK_NOT_EQUAL(viaType, RestrictionWriter::ViaType::Count, ());
AddRestriction(coords, restrictionType, osmIds);
}
return true;

View file

@ -28,6 +28,7 @@
namespace
{
using namespace routing;
std::unique_ptr<IndexGraph>
CreateIndexGraph(std::string const & targetPath,
std::string const & mwmPath,

View file

@ -201,7 +201,7 @@ std::string DebugPrint(RestrictionWriter::ViaType const & type)
{
case RestrictionWriter::ViaType::Node: return RestrictionWriter::kNodeString;
case RestrictionWriter::ViaType::Way: return RestrictionWriter::kWayString;
case RestrictionWriter::ViaType::Max: UNREACHABLE();
case RestrictionWriter::ViaType::Count: UNREACHABLE();
}
UNREACHABLE();
}

View file

@ -19,7 +19,7 @@ public:
Node,
Way,
Max,
Count,
};
static std::string const kNodeString;
@ -28,8 +28,11 @@ public:
RestrictionWriter(std::string const & fullPath,
generator::cache::IntermediateDataReader const & cache);
// generator::CollectorInterface overrides:
// @{
void CollectRelation(RelationElement const & relationElement) override;
void Save() override {}
// @}
static ViaType ConvertFromString(std::string const & str);