Skip to content

Commit 1ea8882

Browse files
committed
Address PR feedback
1 parent 3d652bd commit 1ea8882

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libraries/System.Private.CoreLib/src/System/AppContext.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,24 @@ public static void SetSwitch(string switchName, bool isEnabled)
141141
}
142142
}
143143

144-
#if !NATIVEAOT
145-
internal static unsafe void Setup(char** pNames, char** pValues, int count)
144+
#if MONO
145+
internal static unsafe void Setup(char** pNames, uint* pNameLengths, char** pValues, uint* pValueLengths, int count)
146146
{
147147
Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called");
148148
s_dataStore = new Dictionary<string, object?>(count);
149149
for (int i = 0; i < count; i++)
150150
{
151-
s_dataStore.Add(new string(pNames[i]), new string(pValues[i]));
151+
s_dataStore.Add(new string(pNames[i], 0, (int)pNameLengths[i]), new string(pValues[i], 0, (int)pValueLengths[i]));
152152
}
153153
}
154-
155-
internal static unsafe void Setup(char** pNames, uint* pNameLengths, char** pValues, uint* pValueLengths, int count)
154+
#elif !NATIVEAOT
155+
internal static unsafe void Setup(char** pNames, char** pValues, int count)
156156
{
157157
Debug.Assert(s_dataStore == null, "s_dataStore is not expected to be inited before Setup is called");
158158
s_dataStore = new Dictionary<string, object?>(count);
159159
for (int i = 0; i < count; i++)
160160
{
161-
s_dataStore.Add(new string(pNames[i], 0, (int)pNameLengths[i]), new string(pValues[i], 0, (int)pValueLengths[i]));
161+
s_dataStore.Add(new string(pNames[i]), new string(pValues[i]));
162162
}
163163
}
164164
#endif

0 commit comments

Comments
 (0)