kill foreach opApply iteration (too slow)
This commit is contained in:
parent
c1fcef1873
commit
431dd3c3d2
20
std/d/ast.d
20
std/d/ast.d
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue