Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4bd597f

Browse files
authored
Always inline number conversions (#112061)
* Mark TryConvertFrom as AggressiveInlining* Cover TryConvertTo
1 parent5a8f405 commit4bd597f

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

‎src/libraries/System.Private.CoreLib/src/System/Decimal.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,6 +1573,7 @@ static bool INumberBase<decimal>.TryConvertFromTruncating<TOther>(TOther value,
15731573
returnTryConvertFrom(value,outresult);
15741574
}
15751575

1576+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
15761577
privatestaticboolTryConvertFrom<TOther>(TOthervalue,outdecimalresult)
15771578
whereTOther:INumberBase<TOther>
15781579
{
@@ -1722,6 +1723,7 @@ static bool INumberBase<decimal>.TryConvertToTruncating<TOther>(decimal value, [
17221723
returnTryConvertTo(value,outresult);
17231724
}
17241725

1726+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
17251727
privatestaticboolTryConvertTo<TOther>(decimalvalue,[MaybeNullWhen(false)]outTOtherresult)
17261728
whereTOther:INumberBase<TOther>
17271729
{

‎src/libraries/System.Private.CoreLib/src/System/Double.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ static bool INumberBase<double>.TryConvertFromTruncating<TOther>(TOther value, o
12291229
returnTryConvertFrom(value,outresult);
12301230
}
12311231

1232+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
12321233
privatestaticboolTryConvertFrom<TOther>(TOthervalue,outdoubleresult)
12331234
whereTOther:INumberBase<TOther>
12341235
{
@@ -1378,6 +1379,7 @@ static bool INumberBase<double>.TryConvertToTruncating<TOther>(double value, [Ma
13781379
returnTryConvertTo(value,outresult);
13791380
}
13801381

1382+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
13811383
privatestaticboolTryConvertTo<TOther>(doublevalue,[MaybeNullWhen(false)]outTOtherresult)
13821384
whereTOther:INumberBase<TOther>
13831385
{

‎src/libraries/System.Private.CoreLib/src/System/Half.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,7 @@ static bool INumberBase<Half>.TryConvertFromTruncating<TOther>(TOther value, out
19281928
returnTryConvertFrom(value,outresult);
19291929
}
19301930

1931+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
19311932
privatestaticboolTryConvertFrom<TOther>(TOthervalue,outHalfresult)
19321933
whereTOther:INumberBase<TOther>
19331934
{
@@ -2077,6 +2078,7 @@ static bool INumberBase<Half>.TryConvertToTruncating<TOther>(Half value, [MaybeN
20772078
returnTryConvertTo(value,outresult);
20782079
}
20792080

2081+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
20802082
privatestaticboolTryConvertTo<TOther>(Halfvalue,[MaybeNullWhen(false)]outTOtherresult)
20812083
whereTOther:INumberBase<TOther>
20822084
{

‎src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/NFloat.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,6 +1410,7 @@ static bool INumberBase<NFloat>.TryConvertFromTruncating<TOther>(TOther value, o
14101410
returnTryConvertFrom(value,outresult);
14111411
}
14121412

1413+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
14131414
privatestaticboolTryConvertFrom<TOther>(TOthervalue,outNFloatresult)
14141415
whereTOther:INumberBase<TOther>
14151416
{
@@ -1649,6 +1650,7 @@ static bool INumberBase<NFloat>.TryConvertToTruncating<TOther>(NFloat value, [Ma
16491650
returnTryConvertTo(value,outresult);
16501651
}
16511652

1653+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
16521654
privatestaticboolTryConvertTo<TOther>(NFloatvalue,[MaybeNullWhen(false)]outTOtherresult)
16531655
whereTOther:INumberBase<TOther>
16541656
{

‎src/libraries/System.Private.CoreLib/src/System/Single.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@ static bool INumberBase<float>.TryConvertFromTruncating<TOther>(TOther value, ou
12481248
returnTryConvertFrom(value,outresult);
12491249
}
12501250

1251+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
12511252
privatestaticboolTryConvertFrom<TOther>(TOthervalue,outfloatresult)
12521253
whereTOther:INumberBase<TOther>
12531254
{
@@ -1397,6 +1398,7 @@ static bool INumberBase<float>.TryConvertToTruncating<TOther>(float value, [Mayb
13971398
returnTryConvertTo(value,outresult);
13981399
}
13991400

1401+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
14001402
privatestaticboolTryConvertTo<TOther>(floatvalue,[MaybeNullWhen(false)]outTOtherresult)
14011403
whereTOther:INumberBase<TOther>
14021404
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp