1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Revert "Merge pull request #3814 from est31/iterators_for_for"

This reverts commit adf5056889, reversing
changes made to ee2bc87c0e.
This commit is contained in:
Rémi Verschelde
2016-03-01 18:09:48 +01:00
parent 46bfcd3507
commit 002ff3cc9a
7 changed files with 0 additions and 385 deletions

View File

@@ -1779,20 +1779,6 @@ void GDParser::_parse_block(BlockNode *p_block,bool p_static) {
return;
}
// Little optimisation for common usage "for i in range(...):":
// don't create and initialize a possibly huge array as range()
// would do, but instead create an iterator using xrange()
if (container->type == Node::TYPE_OPERATOR) {
OperatorNode *op = static_cast<OperatorNode *>(container);
if (op->arguments.size() > 0 &&
op->arguments[0]->type == Node::TYPE_BUILT_IN_FUNCTION) {
BuiltInFunctionNode *c = static_cast<BuiltInFunctionNode *>(op->arguments[0]);
if (c->function == GDFunctions::GEN_RANGE) {
c->function = GDFunctions::GEN_XRANGE;
}
}
}
ControlFlowNode *cf_for = alloc_node<ControlFlowNode>();
cf_for->cf_type=ControlFlowNode::CF_FOR;