Skip to content

Commit

Permalink
EnableAotAnalyzer for System.Diagnostics.EventLog
Browse files Browse the repository at this point in the history
Contributes to dotnet#75480
  • Loading branch information
eerhardt committed Feb 7, 2023
1 parent ecd71ac commit 08903a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>annotations</Nullable>
<EnableAOTAnalyzer>false</EnableAOTAnalyzer>
<IsPackable>true</IsPackable>
<PackageDescription>Provides the System.Diagnostics.EventLog class, which allows the applications to use the Windows event log service.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,11 @@ public static EventLogHandle ConvertToSafeHandle(UnsafeNativeMethods.EvtVariant
IntPtr ptr = val.Reference;
if (ptr == IntPtr.Zero)
{
return Array.CreateInstance(typeof(T), 0);
return Array.Empty<T>();
}
else
{
Array array = Array.CreateInstance(typeof(T), (int)val.Count);
Array array = new T[val.Count];
for (int i = 0; i < val.Count; i++)
{
array.SetValue(Marshal.PtrToStructure<T>(ptr), i);
Expand Down

0 comments on commit 08903a4

Please sign in to comment.