From 7eb6a38d234071303383df240dd4c094c7ac6801 Mon Sep 17 00:00:00 2001 From: sowle Date: Thu, 21 Feb 2019 23:01:52 +0300 Subject: [PATCH] wallet2: getting rid of redundant code + compilation fix --- src/wallet/wallet2.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 29e2fe23..7c210431 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2352,25 +2352,6 @@ bool wallet2::is_transfer_unlocked(const transfer_details& td) const return true; } //---------------------------------------------------------------------------------------------------- -namespace -{ - template - T pop_random_value(std::vector& vec) - { - WLT_CHECK_AND_ASSERT_MES(!vec.empty(), T(), "Vector must be non-empty"); - - size_t idx = crypto::rand() % vec.size(); - T res = vec[idx]; - if (idx + 1 != vec.size()) - { - vec[idx] = vec.back(); - } - vec.resize(vec.size() - 1); - - return res; - } -} -//---------------------------------------------------------------------------------------------------- void wallet2::push_offer(const bc_services::offer_details_ex& od, currency::transaction& res_tx) { currency::tx_destination_entry tx_dest;