From f4406b05e0fe00709c1b8c51ca259feb929db418 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 22 Apr 2023 12:53:41 +0900 Subject: [PATCH] class Result -> readonly struct Result --- src/DotRecast.Core/{NodeQueue.cs => SortedQueue.cs} | 0 src/DotRecast.Detour/Result.cs | 2 +- src/DotRecast.Detour/Status.cs | 10 +++++----- 3 files changed, 6 insertions(+), 6 deletions(-) rename src/DotRecast.Core/{NodeQueue.cs => SortedQueue.cs} (100%) diff --git a/src/DotRecast.Core/NodeQueue.cs b/src/DotRecast.Core/SortedQueue.cs similarity index 100% rename from src/DotRecast.Core/NodeQueue.cs rename to src/DotRecast.Core/SortedQueue.cs diff --git a/src/DotRecast.Detour/Result.cs b/src/DotRecast.Detour/Result.cs index b3d3b9d..678efcf 100644 --- a/src/DotRecast.Detour/Result.cs +++ b/src/DotRecast.Detour/Result.cs @@ -68,7 +68,7 @@ namespace DotRecast.Detour } } - public class Result + public readonly struct Result { public readonly T result; public readonly Status status; diff --git a/src/DotRecast.Detour/Status.cs b/src/DotRecast.Detour/Status.cs index b661208..e87b79c 100644 --- a/src/DotRecast.Detour/Status.cs +++ b/src/DotRecast.Detour/Status.cs @@ -22,11 +22,11 @@ namespace DotRecast.Detour { public class Status { - public static Status FAILURE = new Status(0); - public static Status SUCCSESS = new Status(1); - public static Status IN_PROGRESS = new Status(2); - public static Status PARTIAL_RESULT = new Status(3); - public static Status FAILURE_INVALID_PARAM = new Status(4); + public static readonly Status FAILURE = new Status(0); + public static readonly Status SUCCSESS = new Status(1); + public static readonly Status IN_PROGRESS = new Status(2); + public static readonly Status PARTIAL_RESULT = new Status(3); + public static readonly Status FAILURE_INVALID_PARAM = new Status(4); public int Value { get; }