LogFAQs > #934044921

LurkerFAQs, Active DB, DB1, DB2, DB3, DB4, DB5, Database 6 ( 01.01.2020-07.18.2020 ), DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicIsn't this the fastest way to do a for loop
Yellow
02/07/20 1:52:21 AM
#1:


I never, never see this done this way, but it seems like the fastest way to do a for loop.

Instead of

for (int i = 0; i < something; i++)
{
...
}

for (int i = 0; i++ < something;)
{
...
}

I heard adding ++ to the end of an integer while reading basically has no performance loss. Doing it this way basically removes an opcode from every loop, right? I know for loops produce less garbage than foreach.

---
... Copied to Clipboard!
Topic List
Page List: 1