From ef034973500033538b1ea1668aeb55ece759e0aa Mon Sep 17 00:00:00 2001 From: d11n Date: Tue, 10 Oct 2023 05:30:48 +0200 Subject: [PATCH] Fix build warning (#5355) Removes unused `string payoutSource` and shortens return with to ternary operator. --- BTCPayServer/Data/Payouts/PayoutExtensions.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/BTCPayServer/Data/Payouts/PayoutExtensions.cs b/BTCPayServer/Data/Payouts/PayoutExtensions.cs index de2291e4c..c85bb1657 100644 --- a/BTCPayServer/Data/Payouts/PayoutExtensions.cs +++ b/BTCPayServer/Data/Payouts/PayoutExtensions.cs @@ -37,16 +37,9 @@ namespace BTCPayServer.Data { var ppBlob = data.PullPaymentData?.GetBlob(); var payoutBlob = data.GetBlob(jsonSerializerSettings); - string payoutSource; - if (payoutBlob.Metadata?.TryGetValue("source", StringComparison.InvariantCultureIgnoreCase, - out var source) is true) - { - return source.Value(); - } - else - { - return ppBlob?.Name ?? data.PullPaymentDataId; - } + return payoutBlob.Metadata?.TryGetValue("source", StringComparison.InvariantCultureIgnoreCase, out var source) is true + ? source.Value() + : ppBlob?.Name ?? data.PullPaymentDataId; } public static PayoutBlob GetBlob(this PayoutData data, BTCPayNetworkJsonSerializerSettings serializers)