From fa7bae9f7dcec5d0e572488a7b5518a879c72d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kie=C5=82kowicz?= Date: Fri, 5 Apr 2024 07:25:10 +0200 Subject: [PATCH] PR feedback - optimisation --- src/Shared/InstrumentationScopeHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/InstrumentationScopeHelper.cs b/src/Shared/InstrumentationScopeHelper.cs index eceaeab6f4f..b5908d1f5db 100644 --- a/src/Shared/InstrumentationScopeHelper.cs +++ b/src/Shared/InstrumentationScopeHelper.cs @@ -14,6 +14,6 @@ public static string GetPackageVersion() // fills AssemblyInformationalVersionAttribute by // `{NuGetPackageVersion}+{CommitHash}`, e.g. `1.7.0-beta.1.86+33d5521a73e881ac59d4bf1213765270ec2422ff`. // For Scope version, value of AssemblyInformationalVersionAttribute without commit hash is returned. - return typeof(T).Assembly.GetCustomAttribute()!.InformationalVersion.Split('+')[0]; + return typeof(T).Assembly.GetCustomAttribute()!.InformationalVersion.Split(new[] { '+' }, 2)[0]; } }