Skip to content

Commit 1c12cff

Browse files
Fix typo et al. (#339)
* Fix typo et al. * Remove outdated item metadata. * Address PR feedback.
1 parent 2bf740f commit 1c12cff

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

src/Microsoft.DiaSymReader/Extensions/SymUnmanagedExtensions.Scope.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static ISymUnmanagedConstant[] GetConstants(this ISymUnmanagedScope scope
7878
throw new ArgumentNullException(nameof(scope));
7979
}
8080

81-
return EmptyArray<ISymUnmanagedConstant>.Instance;
81+
return [];
8282
}
8383

8484
return scope2.GetConstants();

src/Microsoft.DiaSymReader/Utilities/IUnsafeComStream.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace Microsoft.DiaSymReader
1818
{
1919
/// <summary>
2020
/// This is a re-definition of COM's IStream interface. The important change is that
21-
/// the Read and Write methods take an <see cref="IntPtr"/> instead of a byte[] to avoid the
21+
/// the Read and Write methods take a pointer instead of a byte[] to avoid the
2222
/// allocation cost when called from native code.
2323
/// </summary>
2424
[Guid("0000000c-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
@@ -42,7 +42,7 @@ internal unsafe partial interface IUnsafeComStream
4242
}
4343

4444
#if NET9_0_OR_GREATER
45-
[NativeMarshalling(typeof(STASTGMarshaller))]
45+
[NativeMarshalling(typeof(STATSTGMarshaller))]
4646
public struct STATSTG
4747
{
4848
public string pwcsName;
@@ -58,9 +58,9 @@ public struct STATSTG
5858
public int reserved;
5959
}
6060

61-
[CustomMarshaller(typeof(STATSTG), MarshalMode.ManagedToUnmanagedOut, typeof(STASTGMarshaller))]
62-
[CustomMarshaller(typeof(STATSTG), MarshalMode.UnmanagedToManagedOut, typeof(STASTGMarshaller))]
63-
public static unsafe class STASTGMarshaller
61+
[CustomMarshaller(typeof(STATSTG), MarshalMode.ManagedToUnmanagedOut, typeof(STATSTGMarshaller))]
62+
[CustomMarshaller(typeof(STATSTG), MarshalMode.UnmanagedToManagedOut, typeof(STATSTGMarshaller))]
63+
public static unsafe class STATSTGMarshaller
6464
{
6565
public struct Native
6666
{

src/Microsoft.DiaSymReader/Utilities/InteropUtilities.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@
88

99
namespace Microsoft.DiaSymReader
1010
{
11-
internal static class EmptyArray<T>
12-
{
13-
public static readonly T[] Instance = new T[0];
14-
}
15-
1611
internal class InteropUtilities
1712
{
1813
private static readonly IntPtr s_ignoreIErrorInfo = new IntPtr(-1);
1914

20-
internal static T[] NullToEmpty<T>(T[] items) => (items == null) ? EmptyArray<T>.Instance : items;
15+
internal static T[] NullToEmpty<T>(T[] items) => items == null ? [] : items;
2116

2217
internal static void ThrowExceptionForHR(int hr)
2318
{

0 commit comments

Comments
 (0)