Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\SearchValues\Strings\StringSearchValuesAhoCorasick.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\SearchValues\Strings\StringSearchValuesRabinKarp.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IndexOutOfRangeException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InlineArrays.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InsufficientExecutionStackException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\InsufficientMemoryException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Int16.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Diagnostics;
using System.Globalization;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;

Expand Down Expand Up @@ -478,8 +479,8 @@ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr even
int index;
int refObjIndex = 0;

Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(EightObjects)}");
EightObjects eightObjectStack = default;
Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(InlineArray8<>)}");
InlineArray8<object?> eightObjectStack = default;
Span<int> refObjPosition = stackalloc int[EtwAPIMaxRefObjCount];
Span<object?> dataRefObj = eightObjectStack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,7 @@ public override void Write([StringSyntax(StringSyntaxAttribute.CompositeFormat)]
{
if (GetType() == typeof(StreamWriter))
{
TwoObjects two = new TwoObjects(arg0, arg1);
WriteFormatHelper(format, two, appendNewLine: false);
WriteFormatHelper(format, [arg0, arg1], appendNewLine: false);
}
else
{
Expand All @@ -544,8 +543,7 @@ public override void Write([StringSyntax(StringSyntaxAttribute.CompositeFormat)]
{
if (GetType() == typeof(StreamWriter))
{
ThreeObjects three = new ThreeObjects(arg0, arg1, arg2);
WriteFormatHelper(format, three, appendNewLine: false);
WriteFormatHelper(format, [arg0, arg1, arg2], appendNewLine: false);
}
else
{
Expand Down Expand Up @@ -602,8 +600,7 @@ public override void WriteLine([StringSyntax(StringSyntaxAttribute.CompositeForm
{
if (GetType() == typeof(StreamWriter))
{
TwoObjects two = new TwoObjects(arg0, arg1);
WriteFormatHelper(format, two, appendNewLine: true);
WriteFormatHelper(format, [arg0, arg1], appendNewLine: true);
}
else
{
Expand All @@ -615,8 +612,7 @@ public override void WriteLine([StringSyntax(StringSyntaxAttribute.CompositeForm
{
if (GetType() == typeof(StreamWriter))
{
ThreeObjects three = new ThreeObjects(arg0, arg1, arg2);
WriteFormatHelper(format, three, appendNewLine: true);
WriteFormatHelper(format, [arg0, arg1, arg2], appendNewLine: true);
}
else
{
Expand Down
38 changes: 0 additions & 38 deletions src/libraries/System.Private.CoreLib/src/System/InlineArrays.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ internal abstract class AsciiStringSearchValuesTeddyBase<TBucketized, TStartCase
// We may have up to 8 buckets.
// If we have <= 8 strings, the buckets will be the strings themselves, and TBucketized.Value will be false.
// If we have more than 8, the buckets will be string[], and TBucketized.Value will be true.
private readonly EightObjects _buckets;
private readonly InlineArray8<object?> _buckets;

private readonly Vector512<byte>
_n0Low, _n0High,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,14 +459,12 @@ public static string Format([StringSyntax(StringSyntaxAttribute.CompositeFormat)

public static string Format([StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1)
{
TwoObjects two = new TwoObjects(arg0, arg1);
return FormatHelper(null, format, two);
return FormatHelper(null, format, [arg0, arg1]);
}

public static string Format([StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1, object? arg2)
{
ThreeObjects three = new ThreeObjects(arg0, arg1, arg2);
return FormatHelper(null, format, three);
return FormatHelper(null, format, [arg0, arg1, arg2]);
}

public static string Format([StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, params object?[] args)
Expand Down Expand Up @@ -499,14 +497,12 @@ public static string Format(IFormatProvider? provider, [StringSyntax(StringSynta

public static string Format(IFormatProvider? provider, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1)
{
TwoObjects two = new TwoObjects(arg0, arg1);
return FormatHelper(provider, format, two);
return FormatHelper(provider, format, [arg0, arg1]);
}

public static string Format(IFormatProvider? provider, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1, object? arg2)
{
ThreeObjects three = new ThreeObjects(arg0, arg1, arg2);
return FormatHelper(provider, format, three);
return FormatHelper(provider, format, [arg0, arg1, arg2]);
}

public static string Format(IFormatProvider? provider, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, params object?[] args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1470,14 +1470,12 @@ public StringBuilder AppendFormat([StringSyntax(StringSyntaxAttribute.CompositeF

public StringBuilder AppendFormat([StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1)
{
TwoObjects two = new TwoObjects(arg0, arg1);
return AppendFormat(null, format, (ReadOnlySpan<object?>)two);
return AppendFormat(null, format, [arg0, arg1]);
}

public StringBuilder AppendFormat([StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1, object? arg2)
{
ThreeObjects three = new ThreeObjects(arg0, arg1, arg2);
return AppendFormat(null, format, (ReadOnlySpan<object?>)three);
return AppendFormat(null, format, [arg0, arg1, arg2]);
}

public StringBuilder AppendFormat([StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, params object?[] args)
Expand Down Expand Up @@ -1518,14 +1516,12 @@ public StringBuilder AppendFormat(IFormatProvider? provider, [StringSyntax(Strin

public StringBuilder AppendFormat(IFormatProvider? provider, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1)
{
TwoObjects two = new TwoObjects(arg0, arg1);
return AppendFormat(provider, format, (ReadOnlySpan<object?>)two);
return AppendFormat(provider, format, [arg0, arg1]);
}

public StringBuilder AppendFormat(IFormatProvider? provider, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, object? arg0, object? arg1, object? arg2)
{
ThreeObjects three = new ThreeObjects(arg0, arg1, arg2);
return AppendFormat(provider, format, (ReadOnlySpan<object?>)three);
return AppendFormat(provider, format, [arg0, arg1, arg2]);
}

public StringBuilder AppendFormat(IFormatProvider? provider, [StringSyntax(StringSyntaxAttribute.CompositeFormat)] string format, params object?[] args)
Expand Down