From f3030812ea8f79d4878a158695df0eb8a741b1e7 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Wed, 2 Jan 2019 11:32:35 +0100 Subject: [PATCH] Use static regex --- MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs index 0a97434e3..b68961889 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs @@ -139,9 +139,9 @@ namespace MediaBrowser.MediaEncoding.Encoder var required = codec == Codec.Encoder ? requiredEncoders : requiredDecoders; - Regex regex = new Regex(@"^\s\S{6}\s(?[\w|-]+)\s+.+$", RegexOptions.Multiline); - MatchCollection matches = regex.Matches(output); - var found = matches.Cast() + var found = Regex + .Matches(output, @"^\s\S{6}\s(?[\w|-]+)\s+.+$", RegexOptions.Multiline) + .Cast() .Select(x => x.Groups["codec"].Value) .Where(x => required.Contains(x));