提交 62d067c8 编写于 作者: A Alexey Milovidov

Addition to prev. revision [#METR-22285].

上级 b7cecc17
......@@ -180,15 +180,13 @@ public:
new_top_continent[i] = i;
}
static constexpr size_t max_depth = 1000; /// To avoid infinite loop for bad hierarchy.
RegionDepth depth = 0;
RegionID current = i;
while (true)
{
++depth;
if (depth > max_depth)
if (depth == std::numeric_limits<RegionDepth>::max())
throw Poco::Exception("Logical error in regions hierarchy: region " + DB::toString(current) + " possible is inside infinite loop");
current = new_parents[current];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册