The only time you should worry about creating a temporary object, when it is massive, and the time taken to copy the object will be long enough, and if you do it a lot, for example, or if you make a view of 10 thousand elements and move it from 9999 to 1, 1 stage when checking the time, if it should move or not, and then changing it every time will be a leak. However, a more efficient way would be to test all tests and move once.
source share