remove AssertNoPortals - it's impossible for it to ever hit, and it's kind of expensive (~150ms for 60k portals)

This commit is contained in:
Jonathan 2022-08-09 19:22:42 -04:00
parent ffeecd550f
commit d6411cef01
3 changed files with 0 additions and 22 deletions

View File

@ -74,7 +74,6 @@ enum class portaltype_t {
};
std::list<std::unique_ptr<buildportal_t>> MakeTreePortals_r(tree_t *tree, node_t *node, portaltype_t type, std::list<std::unique_ptr<buildportal_t>> boundary_portals, portalstats_t &stats);
void MakeTreePortals(tree_t *tree);
void AssertNoPortals(tree_t *tree);
std::list<std::unique_ptr<buildportal_t>> MakeHeadnodePortals(tree_t *tree);
void MakePortalsFromBuildportals(tree_t *tree, std::list<std::unique_ptr<buildportal_t>> buildportals);
void EmitAreaPortals(node_t *headnode);

View File

@ -521,8 +521,6 @@ void MakeTreePortals(tree_t *tree)
FreeTreePortals(tree);
AssertNoPortals(tree);
portalstats_t stats{};
auto headnodeportals = MakeHeadnodePortals(tree);
@ -539,23 +537,6 @@ void MakeTreePortals(tree_t *tree)
logging::print(logging::flag::STAT, " {:8} tree portals\n", tree->portals.size());
}
static void AssertNoPortals_r(node_t *node)
{
Q_assert(!node->portals);
if (!node->is_leaf) {
AssertNoPortals_r(node->children[0]);
AssertNoPortals_r(node->children[1]);
}
}
void AssertNoPortals(tree_t *tree)
{
AssertNoPortals_r(tree->headnode);
Q_assert(!tree->outside_node.portals);
Q_assert(tree->portals.empty());
}
/*
=========================================================

View File

@ -263,8 +263,6 @@ void WritePortalFile(tree_t *tree)
FreeTreePortals(tree);
AssertNoPortals(tree);
MakeHeadnodePortals(tree);
portalstats_t stats{};