Skip to content

Commit

Permalink
Address CR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
KeterSCP authored and ForNeVeR committed Jan 23, 2024
1 parent ee8fe59 commit ce42bda
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Cesium.Runtime/StdLibFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public EnvVarsStorage(int bufferLength, Dictionary<string, int> indices)
[FixedAddressValueType]
private static int errNo;

private static EnvVarsStorage? _envVarsStorage;
private static readonly Lazy<EnvVarsStorage> _envVarsStorage = new(InitEnvVarsStorage);

public static int Abs(int value)
{
Expand Down Expand Up @@ -162,11 +162,9 @@ public static int Atoi(byte* ptr)
return null;
}

_envVarsStorage ??= InitEnvVarsStorage();

if (_envVarsStorage.Indices.TryGetValue(envKey, out var envValueIndex))
if (_envVarsStorage.Value.Indices.TryGetValue(envKey, out var envValueIndex))
{
return _envVarsStorage.Values + envValueIndex;
return _envVarsStorage.Value.Values + envValueIndex;
}

return null;
Expand Down

0 comments on commit ce42bda

Please sign in to comment.