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.
2 parents d43d0a0 + 41d4a43 commit a14ecdaCopy full SHA for a14ecda
Scripts/env.cs
@@ -21,7 +21,7 @@ public static class env
21
22
public static readonly string runtimeFilePath = Path.Combine(resourcesDirPath, $"{filename}.txt");
23
24
- private static Dictionary<string, string> _variables;
+ private static Dictionary<string, string> _variables = new();
25
26
public static Dictionary<string, string> variables => _variables ??= ParseEnvironmentFile();
27
@@ -65,9 +65,7 @@ public static Dictionary<string, string> ParseEnvironmentFile()
65
public static bool TryParseEnvironmentVariable(string key, out string value)
66
{
67
68
- value = variables[key];
69
-
70
- return variables.ContainsKey(key);
+ return variables.TryGetValue(key, out value);
71
72
}
73
0 commit comments