Skip to content

Commit d9b07d7

Browse files
committed
Minor codegen improvement to Box<T>
1 parent 6bd669f commit d9b07d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft.Toolkit.HighPerformance/Box{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public static bool TryGetFrom(object obj, [NotNullWhen(true)] out Box<T>? box)
125125
[MethodImpl(MethodImplOptions.AggressiveInlining)]
126126
public static implicit operator T(Box<T> box)
127127
{
128-
return Unsafe.Unbox<T>(box);
128+
return (T)(object)box;
129129
}
130130

131131
/// <summary>

0 commit comments

Comments
 (0)