1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 06:44:10 +02:00

Merge pull request #1469 from disarray2077/patch-2

Allow handling of `ToFileTimeUtc` error
This commit is contained in:
Brian Fiete 2022-02-24 16:14:06 -08:00 committed by GitHub
commit 16d9160bd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -555,15 +555,13 @@ namespace System
return ToUniversalTime().ToFileTimeUtc(); return ToUniversalTime().ToFileTimeUtc();
} }
public int64 ToFileTimeUtc() public Result<int64> ToFileTimeUtc()
{ {
// Treats the input as universal if it is not specified // Treats the input as universal if it is not specified
int64 ticks = ((InternalKind & LocalMask) != 0UL) ? ToUniversalTime().InternalTicks : this.InternalTicks; int64 ticks = ((InternalKind & LocalMask) != 0UL) ? ToUniversalTime().InternalTicks : this.InternalTicks;
ticks -= FileTimeOffset; ticks -= FileTimeOffset;
if (ticks < 0) if (ticks < 0)
{ return .Err;
Runtime.FatalError();
}
return ticks; return ticks;
} }