Skip to content

Commit

Permalink
Do not generate redundant decompositions (WalletWasabi#13260)
Browse files Browse the repository at this point in the history
  • Loading branch information
lontivero authored Jul 15, 2024
1 parent d6a9774 commit 0b51943
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static class Decomposer
{
throw new ArgumentException("Too many denominations. Maximum number is 255.", nameof(target));
}
return denoms.SelectMany(_ => InternalCombinations(target, tolerance: tolerance, maxCount, denoms)).Take(10_000).ToList();
return InternalCombinations(target, tolerance: tolerance, maxCount, denoms).Take(10_000).ToList();
}

private static IEnumerable<(long Sum, int Count, ulong Decomposition)> InternalCombinations(long target, long tolerance, int maxLength, long[] denoms)
Expand Down

0 comments on commit 0b51943

Please sign in to comment.