-=-=-=-=-=-
- CLEANUP -
-=-=-=-=-=-

I tried to make things as consistent as I could while going through Array.au3. I reformatted function headers, made variable naming at least a bit more consistent, and made bounds checking more consistent. If there is an $iStart parameter in the function, it also has an $iEnd. In the process, of making all of these changes, I might've broken backwards compatibility a bit for some functions. They should all be listed in Compatibility.txt though.


-=-=-=-=-=-=-=-
- OPTIMIZING  -
-=-=-=-=-=-=-=-

- [MAJOR] The easiest things to optimize were the loops. Many of the loops weren't as tight as they could be, and people kept using if statements inside the loops when it could just as simply have been done outside of the loop. Making AutoIt check a condition over and over in a loop when the condition is never going to change is a big waste of resources. I can understand why people would want to make the code more elegant by minimizing repetition of code, but if the performance can be increased by anywhere from 50% to 70%, it's just not worth it to write the code in that manner. It's not as if the code becomes unreadable after moving the conditionals outside of the loops either.

So yeah, if performance is an issue to you, then one of the most important things you need to do is make sure that you don't have unnecessary, never-changing conditional checks inside a loop. There may be exceptions, but you'll find this to hold true in most cases. If in doubt, simply run both versions of your function through several hundred or thousand iterations in a loop, and time it to see which one takes less time.

- [MINOR] Using SetError() and then Return "" separately is a bit wasteful, especially since you could simply use Return SetError(1, 0, ""). IIRC, this improved performance by anywhere from 1-5%.

- [MINOR] "If Not $variable Then" is faster than "If $variable = 0 Then" is faster than "If $variable == 0 Then"
