From 08a4df0c6442349742646d48e7ea907d6e25fc6b Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Sun, 2 Apr 2023 02:56:50 +0100 Subject: [PATCH] perf: remove local method, exclude coverage for default arm --- X10D/src/Text/RuneExtensions.cs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/X10D/src/Text/RuneExtensions.cs b/X10D/src/Text/RuneExtensions.cs index 9bb798e90..629d0e113 100644 --- a/X10D/src/Text/RuneExtensions.cs +++ b/X10D/src/Text/RuneExtensions.cs @@ -1,6 +1,5 @@ #if NETCOREAPP3_0_OR_GREATER using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; using System.Globalization; using System.Runtime.CompilerServices; @@ -101,23 +100,15 @@ public static string Repeat(this Rune value, int count) // dotcover disable //NOSONAR default: - return Default(); - //NOSONAR - // dotcover enable - } - - [ExcludeFromCodeCoverage, DoesNotReturn] - string Default() - { - string exceptionFormat = ExceptionMessages.UnexpectedRuneUtf8SequenceLength; - string message = string.Format(CultureInfo.CurrentCulture, exceptionFormat, length); + string exceptionFormat = ExceptionMessages.UnexpectedRuneUtf8SequenceLength; + string message = string.Format(CultureInfo.CurrentCulture, exceptionFormat, length); #if NET7_0_OR_GREATER - throw new UnreachableException(message); + throw new UnreachableException(message); #else throw new InvalidOperationException(message); #endif - - return default; + //NOSONAR + // dotcover enable } } }