temp = Data[index];Data[index] = Data[index+2];Data[index+2] = temp;
I love it how people use temporary values to do swaps...
Try this instead sometime:
Data[index] ^= Data[index+2];Data[index+2] ^= Data[index];Data[index] ^= Data[index+2];
Voila! No temp variable. (I think I did that right)
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but
when you do, it blows away your whole leg."
- Bjarne Stroustrup
Realm Games Company