Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Feb 1, 2025
1 parent 7b6f013 commit 25b9194
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/Snap.Hutao/Snap.Hutao/Core/Graphics/RectInt16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ internal readonly struct RectInt16

private RectInt16(int x, int y, int width, int height)
{
this.X = (short)x;
this.Y = (short)y;
this.Width = (short)width;
this.Height = (short)height;
X = (short)x;
Y = (short)y;
Width = (short)width;
Height = (short)height;
}

public static implicit operator RectInt32(RectInt16 rect)
Expand Down
1 change: 0 additions & 1 deletion src/Snap.Hutao/Snap.Hutao/Core/HutaoRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Microsoft.Win32;
using Microsoft.Windows.AppNotifications;
using Snap.Hutao.Core.ExceptionService;
using Snap.Hutao.Core.IO;
using Snap.Hutao.Core.IO.Hashing;
using Snap.Hutao.Core.Setting;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Google.Protobuf;
using Snap.Hutao.Core.Protobuf;
using System.Buffers;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace Snap.Hutao.Core.LifeCycle.InterProcess.Yae;
Expand Down
7 changes: 3 additions & 4 deletions src/Snap.Hutao/Snap.Hutao/Extension/MemoryPoolExtension.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.

using Microsoft.Extensions.Caching.Memory;
using System.Buffers;

namespace Snap.Hutao.Extension;
Expand All @@ -16,16 +15,16 @@ public static IMemoryOwner<T> RentExactly<T>(this MemoryPool<T> memoryPool, int

private sealed class ExactSizedMemoryOwner<T> : IMemoryOwner<T>
{
private IMemoryOwner<T> owner;
private int bufferSize;
private readonly IMemoryOwner<T> owner;
private readonly int bufferSize;

public ExactSizedMemoryOwner(IMemoryOwner<T> owner, int bufferSize)
{
this.owner = owner;
this.bufferSize = bufferSize;
}

public Memory<T> Memory => owner.Memory.Slice(0, bufferSize);
public Memory<T> Memory { get => owner.Memory.Slice(0, bufferSize); }

public void Dispose()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,6 @@ public async ValueTask<ResinStatistics> GetResinStatisticsAsync(IEnumerable<Stat

private static double GetStatisticsCultivateItemTimes(StatisticsCultivateItem item)
{
return (long)item.Count - (long)item.Current;
return item.Count - (long)item.Current;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Google.Protobuf;
using Snap.Hutao.Core.Protobuf;
using Snap.Hutao.Model.InterChange.Inventory;
using System.Collections.Immutable;

namespace Snap.Hutao.Service.Yae.PlayerStore;

Expand Down Expand Up @@ -50,7 +49,7 @@ internal static class PlayerStoreParser
return new()
{
Info = UIIFInfo.CreateForEmbeddedYae(),
List = [..items.Select(UIIFItem.FromInGameItem)],
List = [.. items.Select(UIIFItem.FromInGameItem)],
};
}
}
Expand Down

0 comments on commit 25b9194

Please sign in to comment.