Minor code refactoring
このコミットが含まれているのは:
1 親
ff01a11409
コミット
90966169fa
2ファイル変更
+4
-16
検索条件に一致するファイルはありません
+3
-13
@@ -11,7 +11,7 @@ namespace System.Runtime.CompilerServices;
|
||||
/// Provides a handler used by the language compiler to process interpolated strings into <see cref="string"/> instances.
|
||||
/// </summary>
|
||||
[InterpolatedStringHandler]
|
||||
public ref struct FormatInterpolatedStringHandler
|
||||
internal ref struct FormatInterpolatedStringHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// Minimum size array to rent from the pool.
|
||||
@@ -96,18 +96,6 @@ public ref struct FormatInterpolatedStringHandler
|
||||
public string ToStringAndClear()
|
||||
{
|
||||
string result = new(characters.Slice(0, position));
|
||||
|
||||
Clear();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears the handler, returning any rented array to the pool.
|
||||
/// </summary>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal void Clear()
|
||||
{
|
||||
char[]? toReturn = arrayToReturnToPool;
|
||||
|
||||
this = default;
|
||||
@@ -116,6 +104,8 @@ public ref struct FormatInterpolatedStringHandler
|
||||
{
|
||||
ArrayPool<char>.Shared.Return(toReturn);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
+1
-3
@@ -1,7 +1,6 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Runtime.CompilerServices;
|
||||
@@ -9,9 +8,8 @@ namespace System.Runtime.CompilerServices;
|
||||
/// <summary>
|
||||
/// Provides a handler used by the language compiler to format interpolated strings into character spans.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[InterpolatedStringHandler]
|
||||
public ref struct TryWriteFormatInterpolatedStringHandler
|
||||
internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
{
|
||||
/// <summary>
|
||||
/// The destination buffer.
|
||||
新しいイシューから参照
ユーザーをブロックする