mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Backfills the standard MIT X11 header on hand-written files that never got one, attributing each to its first-commit author and year from git history. Code vendored from dotnet/runtime and Humanizr/Humanizer gets its origin's license lines and a provenance note instead. Generated files (Resources.Designer.cs, the version-info template), tool-managed suppression files, and BAML test-case fixtures intentionally stay header-less. Assisted-by: Claude:claude-fable-5:Claude Code
27 lines
776 B
C#
27 lines
776 B
C#
// Copyright (c) .NET Foundation and Contributors
|
|
//
|
|
// Vendored from Humanizr/Humanizer (https://github.com/Humanizr/Humanizer), MIT license.
|
|
|
|
namespace Humanizer.Inflections;
|
|
|
|
using CharSpan = System.ReadOnlySpan<System.Char>;
|
|
|
|
/// <summary>
|
|
/// Contains extension methods for humanizing string values.
|
|
/// </summary>
|
|
internal static class StringHumanizeExtensions
|
|
{
|
|
internal static unsafe string Concat(CharSpan left, CharSpan right)
|
|
{
|
|
var result = new string('\0', left.Length + right.Length);
|
|
fixed (char* pResult = result)
|
|
{
|
|
left.CopyTo(new(pResult, left.Length));
|
|
right.CopyTo(new(pResult + left.Length, right.Length));
|
|
}
|
|
return result;
|
|
}
|
|
|
|
internal static unsafe string Concat(char left, CharSpan right) =>
|
|
Concat(new CharSpan(&left, 1), right);
|
|
} |