File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -59,16 +59,13 @@ public JsonPosition(JsonContainerType type)
5959
6060 internal int CalculateLength ( )
6161 {
62- switch ( Type )
62+ return Type switch
6363 {
64- case JsonContainerType . Object :
65- return PropertyName ! . Length + 5 ;
66- case JsonContainerType . Array :
67- case JsonContainerType . Constructor :
68- return MathUtils . IntLength ( ( ulong ) Position ) + 2 ;
69- default :
70- throw new ArgumentOutOfRangeException ( nameof ( Type ) ) ;
71- }
64+ JsonContainerType . Object => PropertyName ! . Length + 5 ,
65+ JsonContainerType . Array or JsonContainerType . Constructor
66+ => MathUtils . IntLength ( ( ulong ) Position ) + 2 ,
67+ _ => throw new ArgumentOutOfRangeException ( nameof ( Type ) )
68+ } ;
7269 }
7370
7471 internal void WriteTo ( StringBuilder sb , ref StringWriter ? writer , ref char [ ] ? buffer )
You can’t perform that action at this time.
0 commit comments