mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 03:25:41 +00:00
perf: remove local method, exclude coverage for default arm
This commit is contained in:
parent
85f4e8c733
commit
08a4df0c64
@ -1,6 +1,5 @@
|
|||||||
#if NETCOREAPP3_0_OR_GREATER
|
#if NETCOREAPP3_0_OR_GREATER
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Diagnostics.Contracts;
|
using System.Diagnostics.Contracts;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
@ -101,23 +100,15 @@ public static class RuneExtensions
|
|||||||
// dotcover disable
|
// dotcover disable
|
||||||
//NOSONAR
|
//NOSONAR
|
||||||
default:
|
default:
|
||||||
return Default();
|
string exceptionFormat = ExceptionMessages.UnexpectedRuneUtf8SequenceLength;
|
||||||
//NOSONAR
|
string message = string.Format(CultureInfo.CurrentCulture, exceptionFormat, length);
|
||||||
// dotcover enable
|
|
||||||
}
|
|
||||||
|
|
||||||
[ExcludeFromCodeCoverage, DoesNotReturn]
|
|
||||||
string Default()
|
|
||||||
{
|
|
||||||
string exceptionFormat = ExceptionMessages.UnexpectedRuneUtf8SequenceLength;
|
|
||||||
string message = string.Format(CultureInfo.CurrentCulture, exceptionFormat, length);
|
|
||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
throw new UnreachableException(message);
|
throw new UnreachableException(message);
|
||||||
#else
|
#else
|
||||||
throw new InvalidOperationException(message);
|
throw new InvalidOperationException(message);
|
||||||
#endif
|
#endif
|
||||||
|
//NOSONAR
|
||||||
return default;
|
// dotcover enable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user