Skip to content

Instantly share code, notes, and snippets.

@irwiss
Last active May 6, 2021 10:49
Show Gist options
  • Save irwiss/9b8992b81f6cb7e92d022a2085b8c6df to your computer and use it in GitHub Desktop.
Save irwiss/9b8992b81f6cb7e92d022a2085b8c6df to your computer and use it in GitHub Desktop.
Faster conditional break, acts something like assert with automatic debugger homing
[System.Diagnostics.DebuggerHidden]
[System.Diagnostics.Conditional("DEBUG")]
public static void DebuggerBreakIf(bool condition)
{
if (condition)
{
System.Diagnostics.Debugger.Break();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment