提交 e0e0a1f8 编写于 作者: D David Kean

Remove allocation of char array

This removes ~214 KB of allocations opening ProjectSystem.sln.
上级 8b735e03
......@@ -21,6 +21,7 @@ public class CSharpCommandLineParser : CommandLineParser
public static CSharpCommandLineParser Default { get; } = new CSharpCommandLineParser();
internal static CSharpCommandLineParser ScriptRunner { get; } = new CSharpCommandLineParser(isScriptRunner: true);
private readonly static char[] s_quoteOrEquals = new[] { '"', '=' };
internal CSharpCommandLineParser(bool isScriptRunner = false)
: base(CSharp.MessageProvider.Instance, isScriptRunner)
......@@ -1656,7 +1657,7 @@ private static IEnumerable<CommandLineReference> ParseAssemblyReferences(string
// /r:alias=reference;reference ... error 2034
// /r:nonidf=reference ... error 1679
int eqlOrQuote = value.IndexOfAny(new[] { '"', '=' });
int eqlOrQuote = value.IndexOfAny(s_quoteOrEquals);
string alias;
if (eqlOrQuote >= 0 && value[eqlOrQuote] == '=')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册