mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-08-04 15:28:23 +00:00
Reduce string allocations by regex
This commit is contained in:
parent
df8346cd63
commit
48263078b4
11 changed files with 22 additions and 62 deletions
|
|
@ -277,7 +277,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
|
||||
if (match.Success)
|
||||
{
|
||||
if (Version.TryParse(match.Groups[1].Value, out var result))
|
||||
if (Version.TryParse(match.Groups[1].ValueSpan, out var result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
|
@ -327,8 +327,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
RegexOptions.Multiline))
|
||||
{
|
||||
var version = new Version(
|
||||
int.Parse(match.Groups["major"].Value, CultureInfo.InvariantCulture),
|
||||
int.Parse(match.Groups["minor"].Value, CultureInfo.InvariantCulture));
|
||||
int.Parse(match.Groups["major"].ValueSpan, CultureInfo.InvariantCulture),
|
||||
int.Parse(match.Groups["minor"].ValueSpan, CultureInfo.InvariantCulture));
|
||||
|
||||
map.Add(match.Groups["name"].Value, version);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue