Skip to content

Commit 84e78c6

Browse files
committed
-
1 parent 9a2c768 commit 84e78c6

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

app/Pog/lib_compiled/Pog/src/Native/Win32/PeResources.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -410,17 +410,14 @@ public static extern unsafe BOOL UpdateResource(ResourceUpdateSafeHandle hUpdate
410410
/// <summary>
411411
/// Represents a Win32 handle that can be closed with <see cref="FreeLibrary"/>.
412412
/// </summary>
413-
public class FreeLibrarySafeHandle
414-
: SafeHandle {
415-
private static readonly IntPtr InvalidHandleValue = new IntPtr(0L);
413+
public class FreeLibrarySafeHandle : SafeHandle {
414+
private static readonly IntPtr InvalidHandleValue = new(0L);
416415
public FreeLibrarySafeHandle() : base(InvalidHandleValue, true) {}
417416

418-
public FreeLibrarySafeHandle(IntPtr preexistingHandle, bool ownsHandle = true) :
419-
base(InvalidHandleValue, ownsHandle) {
420-
this.SetHandle(preexistingHandle);
421-
}
417+
public FreeLibrarySafeHandle(IntPtr preexistingHandle, bool ownsHandle = true)
418+
: base(InvalidHandleValue, ownsHandle) => this.SetHandle(preexistingHandle);
422419

423-
public override bool IsInvalid => this.handle.ToInt64() == 0L;
420+
public override bool IsInvalid => this.handle == InvalidHandleValue;
424421

425422
protected override bool ReleaseHandle() => FreeLibrary((HMODULE) this.handle);
426423
}

0 commit comments

Comments
 (0)