Skip to content

Commit 4b0e40a

Browse files
committed
修复HttpApi.GetName()使用.分割失效的现象;
1 parent 098f8e6 commit 4b0e40a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

WebApiClientCore/HttpApi.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public static string GetName(Type? httpApiType, bool includeNamespace)
3838
var builder = new ValueStringBuilder(stackalloc char[256]);
3939
if (includeNamespace == true)
4040
{
41-
builder.Append(httpApiType.Namespace).Append(".");
41+
builder.Append(httpApiType.Namespace);
42+
builder.Append(".");
4243
}
4344

4445
GetName(httpApiType, ref builder);

WebApiClientCore/Internals/ValueStringBuilder.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ public ValueStringBuilder(Span<char> buffer)
2626
/// <summary>
2727
/// 添加char
2828
/// </summary>
29-
/// <param name="value"></param>
30-
/// <returns></returns>
31-
public ValueStringBuilder Append(char value)
29+
/// <param name="value"></param>
30+
public void Append(char value)
3231
{
3332
var newSize = this.index + 1;
3433
if (newSize > this.chars.Length)
@@ -38,19 +37,18 @@ public ValueStringBuilder Append(char value)
3837

3938
this.chars[this.index..][0] = value;
4039
this.index = newSize;
41-
return this;
4240
}
4341

4442
/// <summary>
4543
/// 添加chars
4644
/// </summary>
4745
/// <param name="value"></param>
4846
/// <returns></returns>
49-
public ValueStringBuilder Append(ReadOnlySpan<char> value)
47+
public void Append(ReadOnlySpan<char> value)
5048
{
5149
if (value.IsEmpty)
5250
{
53-
return this;
51+
return;
5452
}
5553

5654
var newSize = this.index + value.Length;
@@ -61,7 +59,6 @@ public ValueStringBuilder Append(ReadOnlySpan<char> value)
6159

6260
value.CopyTo(this.chars[this.index..]);
6361
this.index = newSize;
64-
return this;
6562
}
6663

6764
/// <summary>

0 commit comments

Comments
 (0)