A game framework written with osu! in mind.
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
2// See the LICENCE file in the repository root for full licence text.
3
4#nullable enable
5
6using System;
7
8namespace osu.Framework.Utils
9{
10 /// <summary>
11 /// Helper class for throwing exceptions in isolated methods, for cases where method inlining is beneficial.
12 /// As throwing directly in that case causes JIT to disable inlining on the surrounding method.
13 /// </summary>
14 // todo: continue implementation and use where required, see https://github.com/ppy/osu-framework/issues/3470.
15 public static class ThrowHelper
16 {
17 public static void ThrowInvalidOperationException(string? message) => throw new InvalidOperationException(message);
18 }
19}