21 std::vector<Term::Option> cleaned;
22 std::sort(m_Options.begin(), m_Options.end());
23 while(!m_Options.empty())
25 const std::size_t count = std::count(m_Options.begin(), m_Options.end(), m_Options[0]);
26 const std::size_t anti_count = std::count(m_Options.begin(), m_Options.end(),
static_cast<Term::Option>(-1 *
static_cast<std::int16_t
>(m_Options[0])));
27 if(count > anti_count) { cleaned.emplace_back(m_Options[0]); }
28 else if(count < anti_count) { cleaned.emplace_back(
static_cast<Term::Option>(-1 *
static_cast<std::int16_t
>(m_Options[0]))); }
29 m_Options.erase(std::remove(m_Options.begin(), m_Options.end(),
static_cast<Term::Option>(-1 *
static_cast<std::int16_t
>(m_Options[0]))), m_Options.end());
30 m_Options.erase(std::remove(m_Options.begin(), m_Options.end(), m_Options[0]), m_Options.end());