diff --git a/src/DotRecast.Detour/DtStatus.cs b/src/DotRecast.Detour/DtStatus.cs index be9e059..63a2797 100644 --- a/src/DotRecast.Detour/DtStatus.cs +++ b/src/DotRecast.Detour/DtStatus.cs @@ -18,6 +18,8 @@ freely, subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ +using System.Runtime.CompilerServices; + namespace DotRecast.Detour { public class DtStatus @@ -45,5 +47,29 @@ namespace DotRecast.Detour { Value = value; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsSuccess() + { + return 0 != (Value & (DT_SUCCSESS.Value | DT_PARTIAL_RESULT.Value)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsFailed() + { + return 0 != (Value & (DT_FAILURE.Value | DT_INVALID_PARAM.Value)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsInProgress() + { + return 0 != (Value & DT_IN_PROGRESS.Value); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsPartial() + { + return 0 != (Value & DT_PARTIAL_RESULT.Value); + } } } \ No newline at end of file diff --git a/src/DotRecast.Detour/DtStatusExtension.cs b/src/DotRecast.Detour/DtStatusExtension.cs deleted file mode 100644 index 8d0da09..0000000 --- a/src/DotRecast.Detour/DtStatusExtension.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace DotRecast.Detour -{ - public static class DtStatusExtension - { - public static bool IsSuccess(this DtStatus @this) - { - return @this == DtStatus.DT_SUCCSESS || @this == DtStatus.DT_PARTIAL_RESULT; - } - - public static bool IsFailed(this DtStatus @this) - { - return @this == DtStatus.DT_FAILURE || @this == DtStatus.DT_INVALID_PARAM; - } - - public static bool IsInProgress(this DtStatus @this) - { - return @this == DtStatus.DT_IN_PROGRESS; - } - - public static bool IsPartial(this DtStatus @this) - { - return @this == DtStatus.DT_PARTIAL_RESULT; - } - } -} \ No newline at end of file