@@ -435,22 +435,18 @@ public static bool IsTabulation(CodePoint codePoint)
435
435
/// <param name="codePoint">The codepoint to evaluate.</param>
436
436
/// <returns><see langword="true"/> if <paramref name="codePoint"/> is a new line indicator; otherwise, <see langword="false"/></returns>
437
437
public static bool IsNewLine ( CodePoint codePoint )
438
- {
439
- // See https://www.unicode.org/standard/reports/tr13/tr13-5.html
440
- switch ( codePoint . Value )
441
- {
442
- case 0x000A : // LINE FEED (LF)
443
- case 0x000B : // LINE TABULATION (VT)
444
- case 0x000C : // FORM FEED (FF)
445
- case 0x000D : // CARRIAGE RETURN (CR)
446
- case 0x0085 : // NEXT LINE (NEL)
447
- case 0x2028 : // LINE SEPARATOR (LS)
448
- case 0x2029 : // PARAGRAPH SEPARATOR (PS)
449
- return true ;
450
- default :
451
- return false ;
452
- }
453
- }
438
+ => codePoint . Value switch
439
+ {
440
+ // See https://www.unicode.org/standard/reports/tr13/tr13-5.html
441
+ 0x000A // LINE FEED (LF)
442
+ or 0x000B // LINE TABULATION (VT)
443
+ or 0x000C // FORM FEED (FF)
444
+ or 0x000D // CARRIAGE RETURN (CR)
445
+ or 0x0085 // NEXT LINE (NEL)
446
+ or 0x2028 // LINE SEPARATOR (LS)
447
+ or 0x2029 => true , // PARAGRAPH SEPARATOR (PS)
448
+ _ => false ,
449
+ } ;
454
450
455
451
/// <summary>
456
452
/// Returns the number of codepoints in a given string buffer.
@@ -518,7 +514,7 @@ public static BidiClass GetBidiClass(CodePoint codePoint)
518
514
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
519
515
public static bool TryGetBidiMirror ( CodePoint codePoint , out CodePoint mirror )
520
516
{
521
- uint value = UnicodeData . GetBidiMirror ( codePoint . Value ) ;
517
+ uint value = UnicodeData . GetBidiMirror ( codePoint . value ) ;
522
518
523
519
if ( value == 0u )
524
520
{
@@ -561,15 +557,15 @@ public static bool TryGetVerticalMirror(CodePoint codePoint, out CodePoint mirro
561
557
/// <param name="codePoint">The codepoint to evaluate.</param>
562
558
/// <returns>The <see cref="LineBreakClass"/>.</returns>
563
559
public static LineBreakClass GetLineBreakClass ( CodePoint codePoint )
564
- => UnicodeData . GetLineBreakClass ( codePoint . Value ) ;
560
+ => UnicodeData . GetLineBreakClass ( codePoint . value ) ;
565
561
566
562
/// <summary>
567
563
/// Gets the <see cref="GraphemeClusterClass"/> for the given codepoint.
568
564
/// </summary>
569
565
/// <param name="codePoint">The codepoint to evaluate.</param>
570
566
/// <returns>The <see cref="GraphemeClusterClass"/>.</returns>
571
567
public static GraphemeClusterClass GetGraphemeClusterClass ( CodePoint codePoint )
572
- => UnicodeData . GetGraphemeClusterClass ( codePoint . Value ) ;
568
+ => UnicodeData . GetGraphemeClusterClass ( codePoint . value ) ;
573
569
574
570
/// <summary>
575
571
/// Gets the <see cref="JoiningClass"/> for the given codepoint.
@@ -585,7 +581,7 @@ internal static JoiningClass GetJoiningClass(CodePoint codePoint)
585
581
/// <param name="codePoint">The codepoint to evaluate.</param>
586
582
/// <returns>The <see cref="ScriptClass"/>.</returns>
587
583
internal static ScriptClass GetScriptClass ( CodePoint codePoint )
588
- => UnicodeData . GetScriptClass ( codePoint . Value ) ;
584
+ => UnicodeData . GetScriptClass ( codePoint . value ) ;
589
585
590
586
/// <summary>
591
587
/// Gets the <see cref="UnicodeCategory"/> for the given codepoint.
@@ -599,7 +595,7 @@ public static UnicodeCategory GetGeneralCategory(CodePoint codePoint)
599
595
return ( UnicodeCategory ) ( AsciiCharInfo [ codePoint . Value ] & UnicodeCategoryMask ) ;
600
596
}
601
597
602
- return UnicodeData . GetUnicodeCategory ( codePoint . Value ) ;
598
+ return UnicodeData . GetUnicodeCategory ( codePoint . value ) ;
603
599
}
604
600
605
601
/// <summary>
0 commit comments