Eliminate repeating CountItems() loop premature micro-optimization

Loop backwards if possible, if not, set a variable and use that instead.
There were a couple of instances where the loop style got changed from
    for (int32 i = CountItems(); --i >= 0;)
to
    for (int32 i = CountItems() - 1; i >= 0; i--) {
but should be functionally equivalent.