From 329ccef6ef184bd05c0dd6988c5c03705baa771a Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Thu, 2 Apr 2020 02:28:30 +0200 Subject: [PATCH] Slightly improve code. --- src/scraplang/apply.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/scraplang/apply.cpp b/src/scraplang/apply.cpp index 280958e..415854f 100644 --- a/src/scraplang/apply.cpp +++ b/src/scraplang/apply.cpp @@ -259,7 +259,6 @@ namespace duck { namespace sl { template std::size_t operator()(const T&) const { return 1; } std::size_t operator()(const mstch::array& parItem) const { return parItem.size(); } - std::size_t operator()(const std::vector& parItem) const { return parItem.size(); } }; class ArraysToStructArrayVisitor : public boost::static_visitor<> { @@ -277,13 +276,6 @@ namespace duck { namespace sl { } } - void operator()(const std::string& parName, const std::vector& parItem) { - for (std::size_t z = 0; z < parItem.size(); ++z) { - auto& curr_map = boost::get(m_array[z]); - curr_map[parName] = parItem[z]; - } - } - template void operator()(const std::string& parName, const T& parItem) { auto& curr_map = boost::get(m_array[0]); @@ -404,7 +396,7 @@ namespace duck { namespace sl { boost::apply_visitor(visitor, itm.second); } - parOut[std::string(curr_struct.name)] = std::move(fix_visitor.steal_struct()); + parOut[std::string(curr_struct.name)] = fix_visitor.steal_struct(); } }