mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 13:06:05 +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
|
@ -52,7 +52,7 @@ namespace lp {
|
|||
std::string m_head;
|
||||
std::vector<lisp_elem> m_elems;
|
||||
void print() {
|
||||
if (m_elems.size()) {
|
||||
if (!m_elems.empty()) {
|
||||
std::cout << '(';
|
||||
std::cout << m_head << ' ';
|
||||
for (auto & el : m_elems)
|
||||
|
@ -133,7 +133,7 @@ namespace lp {
|
|||
lm.m_head = m_line.substr(0, separator);
|
||||
m_line = m_line.substr(lm.m_head.size());
|
||||
eat_blanks();
|
||||
while (m_line.size()) {
|
||||
while (!m_line.empty()) {
|
||||
if (m_line[0] == '(') {
|
||||
lisp_elem el;
|
||||
fill_nested_elem(el);
|
||||
|
@ -152,7 +152,7 @@ namespace lp {
|
|||
}
|
||||
|
||||
void eat_blanks() {
|
||||
while (m_line.size()) {
|
||||
while (!m_line.empty()) {
|
||||
if (m_line[0] == ' ')
|
||||
m_line = m_line.substr(1);
|
||||
else
|
||||
|
@ -205,7 +205,7 @@ namespace lp {
|
|||
|
||||
|
||||
bool is_integer(std::string & s) {
|
||||
if (s.size() == 0) return false;
|
||||
if (s.empty()) return false;
|
||||
return atoi(s.c_str()) != 0 || isdigit(s.c_str()[0]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue