Skip to content

Commit 349169a

Browse files
committed
Improved RuntimeHelpers.ConvertLength codegen
1 parent 9b75c9f commit 349169a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft.Toolkit.HighPerformance/Helpers/Internals/RuntimeHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static unsafe int ConvertLength<TFrom, TTo>(int length)
4242
}
4343
else if (sizeof(TFrom) == 1)
4444
{
45-
return length / sizeof(TTo);
45+
return (int)((uint)length / (uint)sizeof(TTo));
4646
}
4747
else
4848
{

0 commit comments

Comments
 (0)