Code cleanup.

This commit is contained in:
2022-10-02 16:25:45 +08:00
parent 6fb7b97bd8
commit 5fb135bfa5
16 changed files with 26 additions and 29 deletions

View File

@@ -13,7 +13,7 @@
return new T[_size];
}
}
Bucket[] _buckets;
readonly Bucket[] _buckets;
/// <summary>
/// Creates an instance of the <see cref="ArrayPool{T}" /> class with the default maximum list size and bucket capacity.
/// </summary>

View File

@@ -15,7 +15,7 @@ namespace Cryville.Common.Buffers {
return new List<T>(_size);
}
}
Bucket[] _buckets;
readonly Bucket[] _buckets;
/// <summary>
/// Creates an instance of the <see cref="ListPool{T}" /> class with the default maximum list size and bucket capacity.
/// </summary>

View File

@@ -21,8 +21,9 @@ namespace Cryville.Common {
public static void Create(string key, Logger logger) {
Instances[key] = logger;
if (logPath != null) {
Files[key] = new StreamWriter(logPath + "/" + ((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds).ToString() + "-" + key + ".log");
Files[key].AutoFlush = true;
Files[key] = new StreamWriter(logPath + "/" + ((int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds).ToString() + "-" + key + ".log") {
AutoFlush = true
};
}
}
public static void Close() {

View File

@@ -127,7 +127,6 @@ namespace Cryville.Common.Pdt {
/// <returns>An operator of the specific name.</returns>
/// <remarks>The parameter count of the returned operator does not necessarily equal to <paramref name="pc" />.</remarks>
protected abstract PdtOperator GetOperator(string name, int pc);
bool _failure;
unsafe void Operate(PdtOperator op, int pc, bool noset = false) {
fixed (byte* pmem = _mem) {
op.Begin(this);

View File

@@ -1,13 +1,11 @@
using System;
using System.Text;
using UnityEditor;
namespace Cryville.Common.Pdt {
/// <summary>
/// Span on the memory of a <see cref="PdtEvaluatorBase" />.
/// </summary>
public unsafe struct PdtVariableMemory {
byte* _ptr;
readonly byte* _ptr;
/// <summary>
/// The length of the span.
/// </summary>

View File

@@ -17,11 +17,9 @@ namespace Cryville.Common.Unity.UI {
set { m_targetValue = value; }
}
#pragma warning disable IDE0051
protected override void Update() {
base.value = (base.value - m_targetValue) * m_smooth + m_targetValue;
base.Update();
}
#pragma warning restore IDE0051
}
}