foreach vs for
#1

1.

for(new i = 0; i < MAX_PLAYERS; i++)
{
//bla bla
}

2.

foreach(Player, i)
{
//bla bla
}

1 or 2 ? Which is faster ?
Reply
#2

2.foreach !
Reply
#3

Foreach
Reply
#4

Foreach. More easy to working with arrays.

P.S. All poll-threads is typical post hunting for anyone.
Reply
#5

From Y-Less himself:

Quote:
Originally Posted by ******
Посмотреть сообщение
foreach replaces some* loops (normally the main player loop) with a faster, more efficient loop.
Reply
#6

I recieve 3 answers, it seems foreach is fastest and best, close topic, thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)