I wanted to open an issue to understand why `bnb_search` as [implemented](https://github.com/bitcoin/bitcoin/pull/10637) @achow101 does not terminate once an optimal search is found.  This behavior is evident I believe when inspecting the [test](https://github.com/bitcoin/bitcoin/blob/master/src/wallet/test/coinselector_tests.cpp#L178) which sets the target to `5` and uses the utxo pool `4,3,2,1`.  since combinations of `4` are evaluated first, the `bnb_search` finds an optimal solution of `4,1`.  However, instead of terminating when the `best_waste = 0` (no better solution can be found), the search continues and instead finds another solution `2,3` which also has a `best_waste = 0`.  Why not terminate once an optimal solution is found instead of continuing to search?
#include <node/context.h>
#include <wallet/wallet.h>
#include <wallet/coinselection.h>
#include <wallet/coincontrol.h>
#include <amount.h>
#include <primitives/transaction.h>
#include <random.h>
#include <test/util/setup_common.h>
#include <wallet/test/wallet_test_fixture.h>
#include <boost/test/unit_test.hpp>
#include <random>
BOOST_FIXTURE_TEST_SUITE(coinselector_tests, WalletTestingSetup)
#define RUN_TESTS 100
#define RANDOM_REPEATS 5
std::vector<std::unique_ptr<CWalletTx>> wtxn;
typedef std::set<CInputCoin> CoinSet;
static std::vector<COutput> vCoins;
static NodeContext testNode;
static auto testChain = interfaces::MakeChain(testNode);
static CWallet testWallet(testChain.get(), WalletLocation(), WalletDatabase::CreateDummy());
static CAmount balance = 0;
CoinEligibilityFilter filter_standard(1, 6, 0);
CoinEligibilityFilter filter_confirmed(1, 1, 0);
CoinEligibilityFilter filter_standard_extra(6, 6, 0);
CoinSelectionParams coin_selection_params(false, 0, 0, CFeeRate(0), 0);
static void add_coin(const CAmount& nValue, int nInput, std::vector<CInputCoin>& set)