RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Questionable statement?

Questionable statement?

On line 141 of Client.cs, I see the following:

[code:1] for ( int i = 0;; ++i )[/code:1]

I'm wondering if that should be i++ since as written it will skip the first chunk after 0x400000 in line 143 inside the loop:

[code:1] pc.Seek( 0x400000 + (i * chunkSize), SeekOrigin.Begin );[/code:1]

Do I have a point or am I completely wrong?

Thanks,
Ignacio
 

krrios

Administrator
The third statement in a for line is executed after any statements inside the for block. In this case, it's like:

[code:1]int i = 0;

while ( true )
{
..code here..
++i;
}[/code:1]
 
Hmm. I thought a preincrement in the iteration would increment it before the loop started, but a took a closer look and it doesn't. Never mind then.

Thanks,
Ignacio
 
Top