3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00

minor code simplification

This commit is contained in:
Nuno Lopes 2023-10-10 17:19:40 +01:00
parent 01188462d5
commit fcb03aa56c
2 changed files with 4 additions and 11 deletions

View file

@ -753,7 +753,7 @@ namespace smt {
} }
else { else {
if (j != i) { if (j != i) {
m_lemma[j] = m_lemma[i]; m_lemma[j] = l;
m_lemma_atoms.set(j, m_lemma_atoms.get(i)); m_lemma_atoms.set(j, m_lemma_atoms.get(i));
} }
j++; j++;

View file

@ -41,7 +41,7 @@ static_assert(sizeof(unsigned) == 4, "unsigned are 4 bytes");
template<typename T, typename T2U_Proc, typename R=unsigned long long> template<typename T, typename T2U_Proc, typename R=unsigned long long>
class approx_set_tpl : private T2U_Proc { class approx_set_tpl : private T2U_Proc {
protected: protected:
R m_set; R m_set = approx_set_traits<R>::zero;
unsigned e2u(T const & e) const { return T2U_Proc::operator()(e); } unsigned e2u(T const & e) const { return T2U_Proc::operator()(e); }
@ -52,24 +52,17 @@ protected:
static approx_set_tpl r2s(R const & s) { approx_set_tpl r; r.m_set = s; return r; } static approx_set_tpl r2s(R const & s) { approx_set_tpl r; r.m_set = s; return r; }
public: public:
approx_set_tpl(): approx_set_tpl() = default;
m_set(approx_set_traits<R>::zero) {
}
explicit approx_set_tpl(T const & e): explicit approx_set_tpl(T const & e):
m_set(e2s(e)) { m_set(e2s(e)) {
} }
approx_set_tpl(unsigned sz, T const * es): approx_set_tpl(unsigned sz, T const * es) {
m_set(approx_set_traits<R>::zero) {
for (unsigned i = 0; i < sz; i++) for (unsigned i = 0; i < sz; i++)
insert(es[i]); insert(es[i]);
} }
approx_set_tpl(approx_set_tpl const & s):
m_set(s.m_set) {
}
void set(R s) { m_set = s; } void set(R s) { m_set = s; }
R get() const { return m_set; } R get() const { return m_set; }