Review fixes.

This commit is contained in:
Vladimir Byko-Ianko 2017-11-15 17:19:36 +03:00 committed by mpimenov
parent 1a4edbc916
commit 3a3124df69
3 changed files with 8 additions and 8 deletions

View file

@ -127,7 +127,7 @@ public:
(*this)(e.m_weight);
(*this)(e.m_lineId);
// Note. |Edge::m_flags| is not filled fully after deserialization from json.
// So it's necessary to it here.
// So it's necessary to fill it here.
EdgeFlags const flags =
GetEdgeFlags(e.GetTransfer(), e.GetStop1Id(), e.GetStop2Id(), e.GetShapeIds());
(*this)(flags);

View file

@ -248,11 +248,11 @@ void EdgeFlags::SetFlags(uint8_t flags)
string DebugPrint(EdgeFlags const & f)
{
std::ostringstream ss;
ss << "EdgeFlags [m_transfer:" << f.m_transfer;
ss << ", m_isShapeIdsEmpty:" << f.m_isShapeIdsEmpty;
ss << ", m_isShapeIdsSingle:" << f.m_isShapeIdsSingle;
ss << ", m_isShapeIdsSame:" << f.m_isShapeIdsSame;
ss << ", m_isShapeIdsReversed:" << f.m_isShapeIdsReversed << "]";
ss << "EdgeFlags [transfer:" << f.m_transfer;
ss << ", isShapeIdsEmpty:" << f.m_isShapeIdsEmpty;
ss << ", isShapeIdsSingle:" << f.m_isShapeIdsSingle;
ss << ", isShapeIdsSame:" << f.m_isShapeIdsSame;
ss << ", isShapeIdsReversed:" << f.m_isShapeIdsReversed << "]";
return ss.str();
}
@ -388,7 +388,7 @@ EdgeFlags GetEdgeFlags(bool transfer, StopId stopId1, StopId stopId2,
if (singleShapeId)
{
flags.m_isShapeIdsSame =
(stopId1 == shapeIds[0].GetStop1Id() && stopId2 == shapeIds[0].GetStop2Id());
stopId1 == shapeIds[0].GetStop1Id() && stopId2 == shapeIds[0].GetStop2Id();
flags.m_isShapeIdsReversed =
stopId1 == shapeIds[0].GetStop2Id() && stopId2 == shapeIds[0].GetStop1Id();
}

View file

@ -281,7 +281,7 @@ public:
private:
uint8_t BoolToUint(bool b) const { return static_cast<uint8_t>(b ? 1 : 0); }
uint8_t GetBit(uint8_t flags, uint8_t mask) const { return BoolToUint(flags & mask); }
uint8_t GetBit(uint8_t flags, uint8_t mask) const { return BoolToUint((flags & mask) != 0); }
static uint8_t constexpr kTransferMask = 1;
static uint8_t constexpr kEmptyShapeIdsMask = (1 << 1);