From 2b3e6e211a65558271a394bee29c24015466a9d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BE=99=E8=85=BE=E7=8C=AB=E8=B7=83?= <1043137532@qq.com>
Date: Tue, 28 Apr 2026 01:13:03 +0800
Subject: [PATCH] *
---
Extensions/StringExtensions.cs | 2 +-
General/ConcurrentList.cs | 5 +++++
Utils/MathUtils.cs | 20 ++++++++++----------
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/Extensions/StringExtensions.cs b/Extensions/StringExtensions.cs
index 2f1708b..35fa1d5 100644
--- a/Extensions/StringExtensions.cs
+++ b/Extensions/StringExtensions.cs
@@ -166,7 +166,7 @@ public static class StringExtensions {
///
/// 将字符串中的换行符统一替换为指定字符。
- /// 若指定了 ,会将多次换行合并成一次换行。
+ /// 若指定了 ,会将多个连续换行符仅替换为一个目标内容。
///
public static string ReplaceLineEndings(this string input, string newValue, bool mergeMultiple = false) =>
Regex.Replace(input,
diff --git a/General/ConcurrentList.cs b/General/ConcurrentList.cs
index dc6cda8..515e01e 100644
--- a/General/ConcurrentList.cs
+++ b/General/ConcurrentList.cs
@@ -1,4 +1,9 @@
namespace MeloongCore;
+
+///
+/// 线程安全的 实现。
+/// 在 的基础上,当调用枚举器时返回一个临时副本,以避免列表在枚举过程中被修改导致异常。
+///
public class ConcurrentList : SynchronizedCollection, IEnumerable, IEnumerable {
// 构造函数
diff --git a/Utils/MathUtils.cs b/Utils/MathUtils.cs
index d6c4e3d..aad6321 100644
--- a/Utils/MathUtils.cs
+++ b/Utils/MathUtils.cs
@@ -8,9 +8,9 @@ public static class MathUtils {
///
/// 将字符串作为数字,转换为指定进制的形式。
/// 进制数需在 2 到 86 之间,且输入字符串中的每个字符都必须在该进制的字符集中。
- /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86
+ /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86。
///
- public static string RadixConvert(this string input, int fromRadix, int toRadix) {
+ public static string ConvertRadix(this string input, int fromRadix, int toRadix) {
const string digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/+=!?@#$%^&*()[]{}<>;:',";
if (fromRadix < 2 || fromRadix > digits.Length) throw new ArgumentOutOfRangeException(nameof(fromRadix), $"{nameof(fromRadix)} must be between 2 and 86.");
// 零与负数的预处理
@@ -24,24 +24,24 @@ public static class MathUtils {
if (digit == -1 || digit >= fromRadix) throw new ArgumentException($"Character '{c}' in input '{input}' is not a valid digit for radix {fromRadix}.");
realNum = realNum * fromRadix + digit;
}
- return RadixConvert(realNum * (isNegative ? -1 : 1), toRadix);
+ return ConvertRadix(realNum * (isNegative ? -1 : 1), toRadix);
}
///
/// 转换为 2 到 86 进制的字符串。
- /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86
+ /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86。
///
- public static string RadixConvert(this long input, int toRadix) => RadixConvert((BigInteger) input, toRadix);
+ public static string ConvertRadix(this long input, int toRadix) => ConvertRadix((BigInteger) input, toRadix);
///
/// 转换为 2 到 86 进制的字符串。
- /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86
+ /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86。
///
- public static string RadixConvert(this int input, int toRadix) => RadixConvert((BigInteger) input, toRadix);
+ public static string ConvertRadix(this int input, int toRadix) => ConvertRadix((BigInteger) input, toRadix);
///
/// 转换为 2 到 86 进制的字符串。
- /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86
+ /// 进制参考:含大写字母 36,含大小写字母 62,含大小写字母和特殊符号 86。
///
- public static string RadixConvert(this byte input, int toRadix) => RadixConvert((BigInteger) input, toRadix);
- private static string RadixConvert(this BigInteger input, int toRadix) {
+ public static string ConvertRadix(this byte input, int toRadix) => ConvertRadix((BigInteger) input, toRadix);
+ private static string ConvertRadix(this BigInteger input, int toRadix) {
const string digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/+=!?@#$%^&*()[]{}<>;:',";
if (toRadix < 2 || toRadix > digits.Length) throw new ArgumentOutOfRangeException(nameof(toRadix), $"{nameof(toRadix)} must be between 2 and 86.");
// 零与负数的预处理