RocketMod / Rocket.Unturned

Unturned 3 implementation of the RocketMod — .NET Game Server Plugin Framework
MIT License
85 stars 111 forks source link

Less Expensive For Loops and Tphere Fix #48

Closed Kr4ken-9 closed 7 years ago

Kr4ken-9 commented 7 years ago

https://github.com/RocketMod/Rocket/issues/781

fr34kyn01535 commented 7 years ago

Excuse me but I can't accept the change of foreach to for. While it's true that enumerating a collection is in theory faster this change is against the c# language paradigm. I am using alot of Linq calls which all add up a little of time, but they make the code readable and easier to maintain. To come back to your specified mentioned spots, I bet the time you save is insignificant to the time the code would spend in the body anyway, feel free to proof me wrong by setting up an example with a stopwatch. Generally speaking I would rather have clean easy to follow and read code then the 100% optimization, I would have chosen c++ over c# if that was my intent.

cartman-2000 commented 7 years ago

If you can make a commit with just the tphere fix, you maybe able to get it accepted.

fr34kyn01535 commented 7 years ago

I've manually merged the change for tphere, thanks for your contribution!