05.10.2010, 22:20
My results won't always be faster, no, and in fact are slower at very low IDs. After reviewing your code though, I think the following scenario could result in an invalid ID.
There are three players connected, ID 0, 1, and 3. Because the max player ID is three, the random call could return ID 2, which isn't even connected.
I'd also say it's safe to assume using Iter_Random would be a good option.
There are three players connected, ID 0, 1, and 3. Because the max player ID is three, the random call could return ID 2, which isn't even connected.
I'd also say it's safe to assume using Iter_Random would be a good option.