mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 17:15:31 +00:00
Prefer using empty rather than size comparisons.
This commit is contained in:
parent
a83097d5cc
commit
e570940662
56 changed files with 104 additions and 104 deletions
|
@ -67,7 +67,7 @@ namespace polynomial {
|
|||
bool first = true;
|
||||
out << "[";
|
||||
for (unsigned i = 0; i < m_var2degree.size(); ++ i) {
|
||||
if (m_var2degree.size() > 0) {
|
||||
if (!m_var2degree.empty()) {
|
||||
if (!first) {
|
||||
out << ",";
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace upolynomial {
|
|||
|
||||
void core_manager::factors::display(std::ostream & out) const {
|
||||
out << nm().to_string(m_constant);
|
||||
if (m_factors.size() > 0) {
|
||||
if (!m_factors.empty()) {
|
||||
for (unsigned i = 0; i < m_factors.size(); ++ i) {
|
||||
out << " * (";
|
||||
m_upm.display(out, m_factors[i]);
|
||||
|
|
|
@ -532,7 +532,7 @@ bool check_hansel_lift(z_manager & upm, numeral_vector const & C,
|
|||
upm.mul(A_lifted.size(), A_lifted.c_ptr(), B_lifted.size(), B_lifted.c_ptr(), test1);
|
||||
upm.sub(C.size(), C.c_ptr(), test1.size(), test1.c_ptr(), test1);
|
||||
to_zp_manager(br_upm, test1);
|
||||
if (test1.size() != 0) {
|
||||
if (!test1.empty()) {
|
||||
TRACE("polynomial::factorization::bughunt",
|
||||
tout << "sage: R.<x> = ZZ['x']" << endl;
|
||||
tout << "sage: A = "; upm.display(tout, A); tout << endl;
|
||||
|
|
|
@ -401,7 +401,7 @@ namespace upolynomial {
|
|||
} else {
|
||||
if (selection_i >= m_current.size() || (int) current < m_current[selection_i]) {
|
||||
SASSERT(m_factors.get_degree(current) == 1);
|
||||
if (out.size() == 0) {
|
||||
if (out.empty()) {
|
||||
upm.set(m_factors[current].size(), m_factors[current].c_ptr(), out);
|
||||
} else {
|
||||
upm.mul(out.size(), out.c_ptr(), m_factors[current].size(), m_factors[current].c_ptr(), out);
|
||||
|
|
|
@ -3466,11 +3466,11 @@ namespace realclosure {
|
|||
// ---------------------------------
|
||||
|
||||
bool is_monic(value_ref_buffer const & p) {
|
||||
return p.size() > 0 && is_rational_one(p[p.size() - 1]);
|
||||
return !p.empty() && is_rational_one(p[p.size() - 1]);
|
||||
}
|
||||
|
||||
bool is_monic(polynomial const & p) {
|
||||
return p.size() > 0 && is_rational_one(p[p.size() - 1]);
|
||||
return !p.empty() && is_rational_one(p[p.size() - 1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue