I would say it's the correct behaviour.
/ Peter Bortas
Previous text:
2003-03-20 10:26: Subject: for-loop optimization
I just wrote a for-loop like this:
string foo="gazonk";
for(int i=0;i<sizeof(foo);i++) {
... do stuff ...
if (sometimes) foo = foo[1..];
... do stuff ...
}
The problem I discoverd was that when the length of foo is changed, the loop still tries to loop over the original length of foo. The problem dissappeard when I replace sizeof(foo) with a variable and update it when changing the length of foo.
Is this the correct behaviour or is the optimizer doing more than it should here?
/ Marcus Agehall (Trådlös)