diff --git a/base/geo_object_id.cpp b/base/geo_object_id.cpp index b7ba09085c..c523db746a 100644 --- a/base/geo_object_id.cpp +++ b/base/geo_object_id.cpp @@ -89,7 +89,10 @@ std::string DebugPrint(GeoObjectId::Type const & t) std::string DebugPrint(GeoObjectId const & id) { std::ostringstream oss; - oss << DebugPrint(id.GetType()) << " " << id.GetSerialId(); + // To print serial id it's written |id.m_encodedId & kSerialMask| instead of id.GetSerialId(). + // It's done to be able to print a instance of GeoObjectId created by default constructor. + // In case of instance of GeoObjectId created by default ctor GetSerialId() shouldn't be called. + oss << DebugPrint(id.GetType()) << " " << (id.m_encodedId & kSerialMask); return oss.str(); } } // namespace base diff --git a/base/geo_object_id.hpp b/base/geo_object_id.hpp index 0ad64536c2..c79e70b769 100644 --- a/base/geo_object_id.hpp +++ b/base/geo_object_id.hpp @@ -35,6 +35,8 @@ namespace base // and the difference does not seem important. Also this would probably touch the highest bit. class GeoObjectId { + friend std::string DebugPrint(GeoObjectId const & id); + public: // Sources of the objects. enum class Type : uint8_t