diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Database/EnumerableExtension.cs b/src/Snap.Hutao/Snap.Hutao/Core/Database/EnumerableExtension.cs index 64e7415c..7fcc6a51 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/Database/EnumerableExtension.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/Database/EnumerableExtension.cs @@ -1,6 +1,8 @@ // Copyright (c) DGP Studio. All rights reserved. // Licensed under the MIT license. +using System.Runtime.CompilerServices; + namespace Snap.Hutao.Core.Database; /// @@ -15,6 +17,7 @@ internal static class EnumerableExtension /// 源类型 /// 源 /// 选中的值或默认值 + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static TSource? SelectedOrDefault(this IEnumerable source) where TSource : ISelectable { diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/RegistryInterop.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/RegistryInterop.cs index 2b4ab717..c2c7bfcb 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/RegistryInterop.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/RegistryInterop.cs @@ -23,7 +23,7 @@ internal static class RegistryInterop private static string PsExecutablePath { - get => psExecutablePath ??= GetPowershellLocation(); + get => psExecutablePath ??= GetPowerShellLocation(); } /// @@ -86,7 +86,7 @@ internal static class RegistryInterop return null; } - private static string GetPowershellLocation() + private static string GetPowerShellLocation() { string paths = Environment.GetEnvironmentVariable("Path")!; diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Metadata/MetadataService.cs b/src/Snap.Hutao/Snap.Hutao/Service/Metadata/MetadataService.cs index f97e23d4..46497ce2 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Metadata/MetadataService.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Metadata/MetadataService.cs @@ -80,12 +80,12 @@ internal sealed partial class MetadataService : IMetadataService, IMetadataServi } ValueStopwatch stopwatch = ValueStopwatch.StartNew(); - logger.LogInformation("Metadata initializaion begin"); + logger.LogInformation("Metadata initialization begin"); isInitialized = await TryUpdateMetadataAsync(token).ConfigureAwait(false); initializeCompletionSource.TrySetResult(); - logger.LogInformation("Metadata initializaion completed in {time}ms", stopwatch.GetElapsedTime().TotalMilliseconds); + logger.LogInformation("Metadata initialization completed in {time}ms", stopwatch.GetElapsedTime().TotalMilliseconds); } private static string GetTextMapLocale() diff --git a/src/Snap.Hutao/Snap.Hutao/Web/HutaoEndpoints.cs b/src/Snap.Hutao/Snap.Hutao/Web/HutaoEndpoints.cs index 39244bd8..5b60711f 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/HutaoEndpoints.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/HutaoEndpoints.cs @@ -168,7 +168,7 @@ internal static class HutaoEndpoints } #endregion - private const string HutaoMetadataSnapGenshinApi = "http://hutao-metadata.snapgenshin.com"; + private const string HutaoMetadataSnapGenshinApi = "https://hutao-metadata.snapgenshin.com"; private const string HomaSnapGenshinApi = "https://homa.snapgenshin.com"; private const string PatcherDGPStudioApi = "https://patcher.dgp-studio.cn"; private const string StaticSnapGenshinApi = "https://static.snapgenshin.com";