We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TryGetValue
1 parent e73c1b7 commit 0928c93Copy full SHA for 0928c93
csharp/autobuilder/Semmle.Autobuild.CSharp.Tests/BuildScripts.cs
@@ -116,9 +116,8 @@ bool IBuildActions.DirectoryExists(string dir)
116
117
string? IBuildActions.GetEnvironmentVariable(string name)
118
{
119
- if (!GetEnvironmentVariable.ContainsKey(name))
120
- return null;
121
- return GetEnvironmentVariable[name];
+ GetEnvironmentVariable.TryGetValue(name, out var ret);
+ return ret;
122
}
123
124
public string GetCurrentDirectory { get; set; } = "";
0 commit comments