From 197813799fc4f0e83e6ab8b97679498730b877df Mon Sep 17 00:00:00 2001 From: Ruben Buniatyan Date: Mon, 3 Jun 2024 16:48:22 +0200 Subject: [PATCH] Shorten commit check Co-authored-by: Lukasz Rozmej --- src/Nethermind/Nethermind.Core/ProductInfo.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Nethermind/Nethermind.Core/ProductInfo.cs b/src/Nethermind/Nethermind.Core/ProductInfo.cs index 85ecf6f451a..cfebebc8847 100644 --- a/src/Nethermind/Nethermind.Core/ProductInfo.cs +++ b/src/Nethermind/Nethermind.Core/ProductInfo.cs @@ -26,15 +26,13 @@ static ProductInfo() OSArchitecture = RuntimeInformation.OSArchitecture.ToString().ToLowerInvariant(); Runtime = RuntimeInformation.FrameworkDescription; - var version = versionAttr.InformationalVersion; - var index = version.IndexOf('+', StringComparison.Ordinal); + Version = versionAttr.InformationalVersion; + var index = Version.IndexOf('+', StringComparison.Ordinal); - if (index == -1) - Version = version; - else + if (index != -1) { - Commit = version[(index + 1)..]; - Version = version[..Math.Min(index + 9, version.Length - 1)]; + Commit = Version[(index + 1)..]; + Version = Version[..Math.Min(index + 9, version.Length - 1)]; } ClientId = $"{Name}/v{Version}/{OS.ToLowerInvariant()}-{OSArchitecture}/dotnet{Runtime[5..]}";