Created
October 11, 2013 14:28
-
-
Save leppie/6935622 to your computer and use it in GitHub Desktop.
C# COMPILER, Y U MAKE ME SO MUCH CODE WHEN YOU SHOULD KNOW BETTER?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if DEBUG | |
public static XYZ Normalize(this XYZ c, [CallerMemberName] string caller = "") | |
#else | |
public static XYZ Normalize(this XYZ c) | |
#endif | |
{ | |
#if DEBUG // completely needless | |
Debug.Print("normalizing: {0} called from: {1}", c, caller); | |
#endif | |
return new XYZ | |
{ | |
X = c.X / c.Y, | |
Y = 1, | |
Z = c.Z / c.Y, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment