mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-04 18:06:08 +01:00
Small perf improvement when fetching exactly 1 payout by id
This commit is contained in:
parent
5b96ab89fd
commit
9ba03848f2
1 changed files with 9 additions and 1 deletions
|
@ -178,7 +178,15 @@ namespace BTCPayServer.HostedServices
|
|||
|
||||
if (payoutQuery.PayoutIds is not null)
|
||||
{
|
||||
query = query.Where(data => payoutQuery.PayoutIds.Contains(data.Id));
|
||||
if (payoutQuery.PayoutIds.Length == 1)
|
||||
{
|
||||
var payoutId = payoutQuery.PayoutIds[0];
|
||||
query = query.Where(data => data.Id == payoutId);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = query.Where(data => payoutQuery.PayoutIds.Contains(data.Id));
|
||||
}
|
||||
}
|
||||
|
||||
if (payoutQuery.PaymentMethods is not null)
|
||||
|
|
Loading…
Add table
Reference in a new issue