kill foreach opApply iteration (too slow)

This commit is contained in:
Dmitry Olshansky 2013-03-05 23:17:40 +04:00
parent c1fcef1873
commit 431dd3c3d2
2 changed files with 12 additions and 45 deletions

View File

@ -163,19 +163,19 @@ class AssignExpression
{
assert (
operator == TokenType.assign
|| operator == TokenType.plusEqual
|| operator == TokenType.minusEqual
|| operator == TokenType.mulEqual
|| operator == TokenType.divEqual
|| operator == TokenType.modEqual
|| operator == TokenType.bitAndEqual
|| operator == TokenType.bitOrEqual
|| operator == TokenType.xorEqual
|| operator == TokenType.catEqual
|| operator == TokenType.plusEquals
|| operator == TokenType.minusEquals
|| operator == TokenType.mulEquals
|| operator == TokenType.divEquals
|| operator == TokenType.modEquals
|| operator == TokenType.bitAndEquals
|| operator == TokenType.bitOrEquals
|| operator == TokenType.xorEquals
|| operator == TokenType.catEquals
|| operator == TokenType.shiftLeftEqual
|| operator == TokenType.shiftRightEqual
|| operator == TokenType.unsignedShiftRightEqual
|| operator == TokenType.powEqual
|| operator == TokenType.powEquals
);
}
}

View File

@ -102,7 +102,7 @@
*
* Copyright: Brian Schott 2013
* License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt Boost, License 1.0)
* Authors: Brian Schott, Dmitry Olshansky
* Authors: Brian Schott, Dmitry Olshansky
* Source: $(PHOBOSSRC std/d/_lexer.d)
*/
@ -358,39 +358,6 @@ struct TokenRange(LexSrc)
return r;
}
/**
* Foreach operation
*/
int opApply(int delegate(Token) dg)
{
int result = 0;
while (!empty)
{
result = dg(front);
if (result)
break;
popFront();
}
return result;
}
/**
* Foreach operation
*/
int opApply(int delegate(size_t, Token) dg)
{
int result = 0;
int i = 0;
while (!empty)
{
result = dg(i, front);
if (result)
break;
popFront();
}
return result;
}
/**
* Removes the current token from the range
*/