mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
Optimize StringHelper.ToFirstUpper()
This commit is contained in:
parent
d28ee6d714
commit
e5fb071708
1 changed files with 4 additions and 5 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
|
|
@ -25,14 +27,11 @@ namespace MediaBrowser.Model.Extensions
|
|||
|
||||
return string.Create(
|
||||
str.Length,
|
||||
str,
|
||||
str.AsSpan(),
|
||||
(chars, buf) =>
|
||||
{
|
||||
chars[0] = char.ToUpperInvariant(buf[0]);
|
||||
for (int i = 1; i < chars.Length; i++)
|
||||
{
|
||||
chars[i] = buf[i];
|
||||
}
|
||||
buf.Slice(1).CopyTo(chars.Slice(1));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue