Skip to content

Commit

Permalink
Merge pull request #8015 from RandomShaper/optimize-assert
Browse files Browse the repository at this point in the history
Skip asserts on non-debug builds at compiler level
  • Loading branch information
akien-mga committed Mar 13, 2017
2 parents 26c12de + 31af5a3 commit af550e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/gdscript/gd_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ Error GDCompiler::_parse_block(CodeGen &codegen, const GDParser::BlockNode *p_bl
}
} break;
case GDParser::Node::TYPE_ASSERT: {
#ifdef DEBUG_ENABLED
// try subblocks

const GDParser::AssertNode *as = static_cast<const GDParser::AssertNode *>(s);
Expand All @@ -1320,6 +1321,7 @@ Error GDCompiler::_parse_block(CodeGen &codegen, const GDParser::BlockNode *p_bl

codegen.opcodes.push_back(GDFunction::OPCODE_ASSERT);
codegen.opcodes.push_back(ret);
#endif
} break;
case GDParser::Node::TYPE_BREAKPOINT: {
#ifdef DEBUG_ENABLED
Expand Down

0 comments on commit af550e2

Please sign in to comment.