I hereby claim:
- I am blueryth on github.
- I am blueryth (https://keybase.io/blueryth) on keybase.
- I have a public key whose fingerprint is E03A F5EC B4EE ECDE B340 0FCC 7F69 A0DA 876F 7BEC
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Reflection; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditorInternal; | |
/// <summary> | |
/// Class to synchronize the view of the Animator window without requiring hierarchy selection | |
/// </summary> | |
class SyncAnimationControllerTool |
The xor swap is a fairly well-known optimization used in lower level languages | |
to swap the value between two variables without the need for temporary storage. | |
Almost everyone has an opinion on it. It avoids allocation. It reduces | |
readability. It's great! It's bad! | |
Working in VS2013, let's take a look at what C++ does to the swap after | |
optimization. A dynamic environment is required to keep the compiler from | |
making too many optimizations like using constant values, unrolling loops, etc. | |
I'll be setting up a test with arrays of random values on the heap, iterating | |
over the elements and swapping their values. |