diff --git a/src/ansi-c/c_typecheck_expr.cpp b/src/ansi-c/c_typecheck_expr.cpp index 185c576e401..4b84899fc1a 100644 --- a/src/ansi-c/c_typecheck_expr.cpp +++ b/src/ansi-c/c_typecheck_expr.cpp @@ -2566,7 +2566,7 @@ exprt c_typecheck_baset::do_special_functions( // http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html // adjust return type of function to match pointer subtype - if(expr.arguments().size()<1) + if(expr.arguments().empty()) { err_location(f_op); error() << "__sync_* primitives take as least one argument" << eom; diff --git a/src/ansi-c/expr2c.cpp b/src/ansi-c/expr2c.cpp index c50d075abaa..dc0c469b64c 100644 --- a/src/ansi-c/expr2c.cpp +++ b/src/ansi-c/expr2c.cpp @@ -2588,7 +2588,7 @@ std::string expr2ct::convert_code_switch( const codet &src, unsigned indent) { - if(src.operands().size()<1) + if(src.operands().empty()) { unsigned precedence; return convert_norep(src, precedence); diff --git a/src/clobber/clobber_parse_options.cpp b/src/clobber/clobber_parse_options.cpp index 42aadee4326..3026dc3e6aa 100644 --- a/src/clobber/clobber_parse_options.cpp +++ b/src/clobber/clobber_parse_options.cpp @@ -192,7 +192,7 @@ bool clobber_parse_optionst::get_goto_program( const optionst &options, goto_functionst &goto_functions) { - if(cmdline.args.size()==0) + if(cmdline.args.empty()) { error() << "Please provide a program to verify" << eom; return true; diff --git a/src/cpp/cpp_typecheck_compound_type.cpp b/src/cpp/cpp_typecheck_compound_type.cpp index 6e2cce31d74..bb0b207e699 100644 --- a/src/cpp/cpp_typecheck_compound_type.cpp +++ b/src/cpp/cpp_typecheck_compound_type.cpp @@ -466,7 +466,7 @@ void cpp_typecheckt::typecheck_compound_declarator( { is_virtual=true; const code_typet &code_type=to_code_type(comp.type()); - assert(code_type.parameters().size()>0); + assert(!code_type.parameters().empty()); const typet &pointer_type=code_type.parameters()[0].type(); assert(pointer_type.id()==ID_pointer); virtual_bases.insert(pointer_type.subtype().get(ID_identifier)); diff --git a/src/cpp/cpp_typecheck_conversions.cpp b/src/cpp/cpp_typecheck_conversions.cpp index 1e33634ebef..cc357d1fb21 100644 --- a/src/cpp/cpp_typecheck_conversions.cpp +++ b/src/cpp/cpp_typecheck_conversions.cpp @@ -574,13 +574,13 @@ bool cpp_typecheckt::standard_conversion_pointer_to_member( expr.type().subtype().id()==ID_code) { code_typet code1=to_code_type(expr.type().subtype()); - assert(code1.parameters().size()>0); + assert(!code1.parameters().empty()); code_typet::parametert this1=code1.parameters()[0]; assert(this1.get(ID_C_base_name)==ID_this); code1.parameters().erase(code1.parameters().begin()); code_typet code2=to_code_type(type.subtype()); - assert(code2.parameters().size()>0); + assert(!code2.parameters().empty()); code_typet::parametert this2=code2.parameters()[0]; assert(this2.get(ID_C_base_name)==ID_this); code2.parameters().erase(code2.parameters().begin()); diff --git a/src/cpp/cpp_typecheck_expr.cpp b/src/cpp/cpp_typecheck_expr.cpp index 979572c717e..e2926f09607 100644 --- a/src/cpp/cpp_typecheck_expr.cpp +++ b/src/cpp/cpp_typecheck_expr.cpp @@ -1431,7 +1431,7 @@ void cpp_typecheckt::typecheck_expr_cpp_name( // http://gcc.gnu.org/onlinedocs/gcc-4.1.1/gcc/Atomic-Builtins.html // adjust return type of function to match pointer subtype - if(fargs.operands.size()<1) + if(fargs.operands.empty()) { error().source_location=source_location; error() << "__sync_* primitives take as least one argument" diff --git a/src/goto-cc/compile.cpp b/src/goto-cc/compile.cpp index aa3256da590..f9184b86598 100644 --- a/src/goto-cc/compile.cpp +++ b/src/goto-cc/compile.cpp @@ -102,13 +102,13 @@ bool compilet::doit() return true; } - if(mode==LINK_LIBRARY && source_files.size()>0) + if(mode==LINK_LIBRARY && !source_files.empty()) { error() << "cannot link source files" << eom; return true; } - if(mode==PREPROCESS_ONLY && object_files.size()>0) + if(mode==PREPROCESS_ONLY && !object_files.empty()) { error() << "cannot preprocess object files" << eom; return true; @@ -117,7 +117,7 @@ bool compilet::doit() const unsigned warnings_before= get_message_handler().get_message_count(messaget::M_WARNING); - if(source_files.size()>0) + if(!source_files.empty()) if(compile()) return true; @@ -346,7 +346,7 @@ bool compilet::link() convert_symbols(compiled_functions); // parse object files - while(object_files.size()>0) + while(!object_files.empty()) { std::string file_name=object_files.front(); object_files.pop_front(); diff --git a/src/goto-cc/xml_binaries/xml_goto_function.cpp b/src/goto-cc/xml_binaries/xml_goto_function.cpp index ff35c86e253..589838154fe 100644 --- a/src/goto-cc/xml_binaries/xml_goto_function.cpp +++ b/src/goto-cc/xml_binaries/xml_goto_function.cpp @@ -33,6 +33,5 @@ void convert(const xmlt &xml, goto_functionst::goto_functiont &function) { function.body.clear(); convert(xml, function.body); - function.body_available = function.body.instructions.size()>0; // don't forget to fix the functions type via the symbol table! } diff --git a/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp b/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp index 8d578451fac..23769f5b441 100644 --- a/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp +++ b/src/goto-cc/xml_binaries/xml_goto_function_hashing.cpp @@ -38,6 +38,5 @@ void xml_goto_function_convertt::convert( xml_goto_program_convertt gpconverter(ireps_container); function.body.clear(); gpconverter.convert(xml, function.body); - function.body_available = function.body.instructions.size()>0; // don't forget to fix the functions type via the symbol table! } diff --git a/src/goto-cc/xml_binaries/xml_symbol.cpp b/src/goto-cc/xml_binaries/xml_symbol.cpp index e62ebe7f657..a323d4ef2ab 100644 --- a/src/goto-cc/xml_binaries/xml_symbol.cpp +++ b/src/goto-cc/xml_binaries/xml_symbol.cpp @@ -54,7 +54,7 @@ void convert(const symbolt &sym, xmlt &root) flags.new_element("base_name").data=id2string(sym.base_name); flags.new_element("module").data=id2string(sym.module); - if(sym.pretty_name.size()>0) + if(!sym.pretty_name.empty()) flags.new_element("pretty_name").data=id2string(sym.pretty_name); xmlt &xmlloc = xmlsym.new_element("location"); diff --git a/src/goto-instrument/accelerate/acceleration_utils.cpp b/src/goto-instrument/accelerate/acceleration_utils.cpp index 0bd48d492b3..7da7a6dce8d 100644 --- a/src/goto-instrument/accelerate/acceleration_utils.cpp +++ b/src/goto-instrument/accelerate/acceleration_utils.cpp @@ -573,7 +573,7 @@ bool acceleration_utilst::do_arrays( << " array assignments\n"; #endif - if(array_assignments.size()==0) + if(array_assignments.empty()) { // The loop doesn't write to any arrays. We're done! return true; diff --git a/src/goto-instrument/accelerate/trace_automaton.cpp b/src/goto-instrument/accelerate/trace_automaton.cpp index 705225cfba9..ac885fcf0f4 100644 --- a/src/goto-instrument/accelerate/trace_automaton.cpp +++ b/src/goto-instrument/accelerate/trace_automaton.cpp @@ -366,7 +366,7 @@ void automatont::reverse(goto_programt::targett epsilon) transitions.push_back(transitionst()); } - if(accept_states.size()==0) + if(accept_states.empty()) { num_states=0; return; diff --git a/src/goto-instrument/rw_set.h b/src/goto-instrument/rw_set.h index eba731d705c..15c3766f23c 100644 --- a/src/goto-instrument/rw_set.h +++ b/src/goto-instrument/rw_set.h @@ -266,13 +266,13 @@ class rw_set_with_trackt:public _rw_set_loct void track_deref(const entryt &entry, bool read) { - if(dereferencing && dereferenced.size()==0) + if(dereferencing && dereferenced.empty()) { dereferenced.insert(dereferenced.begin(), entry); if(read) set_reads.insert(entry.object); } - else if(dereferencing && dereferenced.size()>0) + else if(dereferencing && !dereferenced.empty()) dereferenced_from.insert( std::make_pair(entry.object, dereferenced.front().object)); } diff --git a/src/goto-instrument/wmm/cycle_collection.cpp b/src/goto-instrument/wmm/cycle_collection.cpp index 1012ae40cdc..465b013aa6f 100644 --- a/src/goto-instrument/wmm/cycle_collection.cpp +++ b/src/goto-instrument/wmm/cycle_collection.cpp @@ -521,21 +521,21 @@ bool event_grapht::graph_explorert::backtrack( std::stack tmp; - while(marked_stack.size()>0 && marked_stack.top()!=vertex) + while(!marked_stack.empty() && marked_stack.top()!=vertex) { tmp.push(marked_stack.top()); mark[marked_stack.top()]=false; marked_stack.pop(); } - if(marked_stack.size()>0) + if(!marked_stack.empty()) { assert(marked_stack.top()==vertex); mark[vertex]=true; } else { - while(tmp.size()>0) + while(!tmp.empty()) { marked_stack.push(tmp.top()); mark[tmp.top()]=true; diff --git a/src/goto-instrument/wmm/event_graph.cpp b/src/goto-instrument/wmm/event_graph.cpp index 9342a9268f8..d5d9df2aff4 100644 --- a/src/goto-instrument/wmm/event_graph.cpp +++ b/src/goto-instrument/wmm/event_graph.cpp @@ -55,7 +55,7 @@ void event_grapht::print_rec_graph(std::ofstream &file, event_idt node_id, void event_grapht::print_graph() { - assert(po_order.size()>0); + assert(!po_order.empty()); std::set visited; event_idt root=po_order.front(); std::ofstream file; @@ -113,7 +113,7 @@ event_idt event_grapht::copy_segment(event_idt begin, event_idt end) /* collects the nodes of the subgraph */ explore_copy_segment(covered, begin, end); - if(covered.size()==0) + if(covered.empty()) return end; // for(std::set::const_iterator it=covered.begin(); diff --git a/src/goto-instrument/wmm/event_graph.h b/src/goto-instrument/wmm/event_graph.h index 7670059ed43..61428a934a0 100644 --- a/src/goto-instrument/wmm/event_graph.h +++ b/src/goto-instrument/wmm/event_graph.h @@ -178,7 +178,7 @@ class event_grapht { critical_cyclet reduced(egraph, id); this->hide_internals(reduced); - assert(reduced.size()>0); + assert(!reduced.empty()); return print_name(reduced, model); } else diff --git a/src/goto-instrument/wmm/weak_memory.cpp b/src/goto-instrument/wmm/weak_memory.cpp index 0e9f0e8904c..5b0c4163f83 100644 --- a/src/goto-instrument/wmm/weak_memory.cpp +++ b/src/goto-instrument/wmm/weak_memory.cpp @@ -189,7 +189,7 @@ void weak_memory( <<" cycles found"<0) + if(!unused_functions.empty()) { message.statistics() << "Dropping " << unused_functions.size() << " of " << diff --git a/src/goto-programs/show_goto_functions_json.cpp b/src/goto-programs/show_goto_functions_json.cpp index da9c2424322..ea25d5c0f7f 100644 --- a/src/goto-programs/show_goto_functions_json.cpp +++ b/src/goto-programs/show_goto_functions_json.cpp @@ -76,7 +76,7 @@ json_objectt show_goto_functions_jsont::convert( instruction_entry["instruction"]= json_stringt(instruction_builder.str()); - if(instruction.code.operands().size()>0) + if(!instruction.code.operands().empty()) { json_arrayt operand_array; for(const exprt &operand : instruction.code.operands()) diff --git a/src/java_bytecode/java_bytecode_convert_method.cpp b/src/java_bytecode/java_bytecode_convert_method.cpp index dd3cb32ce26..871f82b6c11 100644 --- a/src/java_bytecode/java_bytecode_convert_method.cpp +++ b/src/java_bytecode/java_bytecode_convert_method.cpp @@ -1772,7 +1772,7 @@ codet java_bytecode_convert_methodt::convert_instructions( } else if(statement=="putfield") { - assert(op.size()==2 && results.size()==0); + assert(op.size()==2 && results.empty()); code_blockt block; save_stack_entries( "stack_field", @@ -1948,7 +1948,7 @@ codet java_bytecode_convert_methodt::convert_instructions( else if(statement=="tableswitch" || statement=="lookupswitch") { - assert(op.size()==1 && results.size()==0); + assert(op.size()==1 && results.empty()); // we turn into switch-case code_switcht code_switch; @@ -2298,7 +2298,7 @@ codet java_bytecode_convert_methodt::convert_instructions( code_labelt newlabel(label(std::to_string(address)), code_blockt()); root_block.move_to_operands(newlabel); root.branch.push_back(block_tree_nodet::get_leaf()); - assert((root.branch_addresses.size()==0 || + assert((root.branch_addresses.empty() || root.branch_addresses.back()::const_iterator e_it=C_j.begin(); std::list::const_iterator next_it=e_it; - assert(C_j.size()>0); + assert(!C_j.empty()); ++next_it; for(; next_it!=C_j.end() && e_it!=C_j.end(); ++e_it, ++next_it) { diff --git a/src/musketeer/fencer.cpp b/src/musketeer/fencer.cpp index 1f612d35e3b..86de5d8fc8b 100644 --- a/src/musketeer/fencer.cpp +++ b/src/musketeer/fencer.cpp @@ -111,7 +111,7 @@ void fence_weak_memory( << " cycles found" << messaget::eom; /* if no cycle, no need to instrument */ - if(instrumenter.set_of_cycles.size() == 0) + if(instrumenter.set_of_cycles.empty()) { message.result() << "program safe -- no need to place additional fences" diff --git a/src/musketeer/graph_visitor.cpp b/src/musketeer/graph_visitor.cpp index 2ecca9e8651..5c46243958d 100644 --- a/src/musketeer/graph_visitor.cpp +++ b/src/musketeer/graph_visitor.cpp @@ -35,7 +35,7 @@ void const_graph_visitort::graph_explore( edges.insert(fence_inserter.add_edge(edget(*it, *next_it))); } } - else if(egraph.po_out(next).size()==0) + else if(egraph.po_out(next).empty()) { /* this path is not connecting a to b => return */ } @@ -76,7 +76,7 @@ void const_graph_visitort::const_graph_explore( fence_inserter.add_edge(edget(*it, *next_it)); } } - else if(egraph.po_out(next).size()==0) + else if(egraph.po_out(next).empty()) { /* this path is not connecting a to b => return */ } @@ -106,7 +106,7 @@ void const_graph_visitort::graph_explore_BC( bool porw) { /* TODO: restricts to C_1 U ... U C_n for perf improvement */ - assert(old_path.size()>0); + assert(!old_path.empty()); fence_inserter.instrumenter.message.debug() << "(BC) explore " << old_path.front() @@ -129,7 +129,7 @@ void const_graph_visitort::graph_explore_BC( break; } - if(egraph.po_out(next).size()==0 || no_other_pos) + if(egraph.po_out(next).empty() || no_other_pos) { /* inserts all the pos collected from old_path in edges */ std::list::const_iterator it=old_path.begin(); @@ -184,7 +184,7 @@ void const_graph_visitort::const_graph_explore_BC( break; } - if(egraph.po_out(next).size()==0 || no_other_pos) + if(egraph.po_out(next).empty() || no_other_pos) { /* inserts all the pos collected from old_path in edges */ std::list::const_iterator it=old_path.begin(); @@ -244,7 +244,7 @@ void const_graph_visitort::graph_explore_AC( break; } - if(egraph.po_in(next).size()==0 || no_other_pos) + if(egraph.po_in(next).empty() || no_other_pos) { /* inserts all the pos collected from old_path in edges */ std::list::const_iterator it=old_path.begin(); @@ -300,7 +300,7 @@ void const_graph_visitort::const_graph_explore_AC( } /* if beginning of the thread */ - if(egraph.po_in(next).size()==0 || no_other_pos) + if(egraph.po_in(next).empty() || no_other_pos) { /* inserts all the pos collected from old_path in edges */ std::list::const_iterator it=old_path.begin(); diff --git a/src/musketeer/propagate_const_function_pointers.cpp b/src/musketeer/propagate_const_function_pointers.cpp index 07838ce8d35..fa96cb63a75 100644 --- a/src/musketeer/propagate_const_function_pointers.cpp +++ b/src/musketeer/propagate_const_function_pointers.cpp @@ -151,7 +151,7 @@ void const_function_pointer_propagationt::dup_caller_and_inline_callee( const symbol_exprt &const_function, unsigned stack_scope) { - assert(callsite_stack.size()>0); + assert(!callsite_stack.empty()); /* for the reconstruction of the {call,callsite}_stacks after the duplication */ @@ -209,8 +209,7 @@ void const_function_pointer_propagationt::dup_caller_and_inline_callee( it!=function_dup.body.instructions.end(); ++it) it->function=function_new_id; - assert(goto_functions.function_map[function_new_id]. - body.instructions.size()>0); + assert(goto_functions.function_map[function_new_id].body.empty()); /* removes in definition the argument leading to the const_function */ code_typet::parameterst &args=function_dup.type.parameters(); diff --git a/src/pointer-analysis/value_set.cpp b/src/pointer-analysis/value_set.cpp index 9c30fbe3ca7..f6a9f128c5c 100644 --- a/src/pointer-analysis/value_set.cpp +++ b/src/pointer-analysis/value_set.cpp @@ -536,7 +536,7 @@ void value_sett::get_value_set_rec( get_value_set_rec(expr.op0(), tmp, suffix, original_type, ns); - if(tmp.read().size()==0) + if(tmp.read().empty()) { // if not, throw in integer insert(dest, exprt(ID_integer_address, unsigned_char_type())); diff --git a/src/pointer-analysis/value_set_fivr.cpp b/src/pointer-analysis/value_set_fivr.cpp index 2acb06ad601..9c8edfeb769 100644 --- a/src/pointer-analysis/value_set_fivr.cpp +++ b/src/pointer-analysis/value_set_fivr.cpp @@ -104,7 +104,7 @@ void value_set_fivrt::output( } out << display_name << "={ "; - if(object_map.read().size()!=0) + if(!object_map.read().empty()) out << "\n "; std::size_t width=0; diff --git a/src/pointer-analysis/value_set_fivrns.cpp b/src/pointer-analysis/value_set_fivrns.cpp index 034b0839da0..63373e09226 100644 --- a/src/pointer-analysis/value_set_fivrns.cpp +++ b/src/pointer-analysis/value_set_fivrns.cpp @@ -95,7 +95,7 @@ void value_set_fivrnst::output_entry( const object_mapt &object_map=e.object_map; out << display_name << " = { "; - if(object_map.read().size()!=0) + if(!object_map.read().empty()) out << "\n "; std::size_t width=0; diff --git a/src/solvers/flattening/boolbv.cpp b/src/solvers/flattening/boolbv.cpp index 3c6de247d15..b3edb8e24cf 100644 --- a/src/solvers/flattening/boolbv.cpp +++ b/src/solvers/flattening/boolbv.cpp @@ -501,7 +501,7 @@ literalt boolbvt::convert_rest(const exprt &expr) const bvt &bv=convert_bv(operands[0]); - if(bv.size()<1) + if(bv.empty()) throw "sign operator takes one non-empty operand"; if(operands[0].type().id()==ID_signedbv) diff --git a/src/solvers/flattening/boolbv_not.cpp b/src/solvers/flattening/boolbv_not.cpp index b0f33f76b9c..e88955b10f6 100644 --- a/src/solvers/flattening/boolbv_not.cpp +++ b/src/solvers/flattening/boolbv_not.cpp @@ -13,7 +13,7 @@ bvt boolbvt::convert_not(const not_exprt &expr) { const bvt &op_bv=convert_bv(expr.op()); - if(op_bv.size()<1) + if(op_bv.empty()) throw "not operator takes one non-empty operand"; const typet &op_type=expr.op().type(); diff --git a/src/solvers/flattening/boolbv_reduction.cpp b/src/solvers/flattening/boolbv_reduction.cpp index 2e2850fd2c8..8472a16cc5c 100644 --- a/src/solvers/flattening/boolbv_reduction.cpp +++ b/src/solvers/flattening/boolbv_reduction.cpp @@ -13,7 +13,7 @@ literalt boolbvt::convert_reduction(const unary_exprt &expr) { const bvt &op_bv=convert_bv(expr.op()); - if(op_bv.size()<1) + if(op_bv.empty()) throw "reduction operators take one non-empty operand"; enum { O_OR, O_AND, O_XOR } op; @@ -53,7 +53,7 @@ bvt boolbvt::convert_bv_reduction(const unary_exprt &expr) { const bvt &op_bv=convert_bv(expr.op()); - if(op_bv.size()<1) + if(op_bv.empty()) throw "reduction operators take one non-empty operand"; enum { O_OR, O_AND, O_XOR } op; diff --git a/src/solvers/prop/prop_conv.cpp b/src/solvers/prop/prop_conv.cpp index f7274994d16..72caa7ec6e2 100644 --- a/src/solvers/prop/prop_conv.cpp +++ b/src/solvers/prop/prop_conv.cpp @@ -415,7 +415,7 @@ void prop_conv_solvert::set_to(const exprt &expr, bool value) // Special case for a CNF-clause, // i.e., a constraint that's a disjunction. - if(expr.operands().size()>0) + if(!expr.operands().empty()) { bvt bv; bv.reserve(expr.operands().size()); diff --git a/src/solvers/sat/satcheck_glucose.cpp b/src/solvers/sat/satcheck_glucose.cpp index adcfbded617..cb511843956 100644 --- a/src/solvers/sat/satcheck_glucose.cpp +++ b/src/solvers/sat/satcheck_glucose.cpp @@ -154,7 +154,7 @@ propt::resultt satcheck_glucose_baset::prop_solve() { messaget::status() << "SAT checker: instance is SATISFIABLE" << eom; - assert(solver->model.size()!=0); + assert(!solver->model.empty()); status=SAT; return P_SATISFIABLE; } diff --git a/src/solvers/sat/satcheck_minisat2.cpp b/src/solvers/sat/satcheck_minisat2.cpp index cab952930f6..1cd70665814 100644 --- a/src/solvers/sat/satcheck_minisat2.cpp +++ b/src/solvers/sat/satcheck_minisat2.cpp @@ -155,7 +155,7 @@ propt::resultt satcheck_minisat2_baset::prop_solve() { messaget::status() << "SAT checker: instance is SATISFIABLE" << eom; - assert(solver->model.size()!=0); + assert(!solver->model.empty()); status=statust::SAT; return resultt::P_SATISFIABLE; } diff --git a/src/solvers/smt2/smt2_conv.cpp b/src/solvers/smt2/smt2_conv.cpp index 11f6b4c5dd1..a26dd2445c6 100644 --- a/src/solvers/smt2/smt2_conv.cpp +++ b/src/solvers/smt2/smt2_conv.cpp @@ -2833,7 +2833,7 @@ void smt2_convt::convert_relation(const exprt &expr) void smt2_convt::convert_plus(const plus_exprt &expr) { - if(expr.operands().size()==0) + if(expr.operands().empty()) { INVALIDEXPR("No operands to plus"); } diff --git a/src/util/ieee_float.cpp b/src/util/ieee_float.cpp index 448719b8465..5f8828ca76b 100644 --- a/src/util/ieee_float.cpp +++ b/src/util/ieee_float.cpp @@ -302,7 +302,7 @@ std::string ieee_floatt::to_string_scientific(std::size_t precision) const std::string exponent_str= integer2string(base10_digits(_fraction)+_exponent-1); - if(exponent_str.size()>0 && exponent_str[0]!='-') + if(!exponent_str.empty() && exponent_str[0]!='-') result+='+'; result+=exponent_str; diff --git a/src/util/json_irep.cpp b/src/util/json_irep.cpp index 7f8c0b58b16..3cefcb9306c 100644 --- a/src/util/json_irep.cpp +++ b/src/util/json_irep.cpp @@ -52,7 +52,7 @@ void json_irept::convert_sub_tree( const irept::subt &sub_trees, json_objectt &parent) const { - if(sub_trees.size()>0) + if(!sub_trees.empty()) { json_arrayt sub_objects; for(const irept &sub_tree : sub_trees) @@ -77,7 +77,7 @@ void json_irept::convert_named_sub_tree( const irept::named_subt &sub_trees, json_objectt &parent) const { - if(sub_trees.size()>0) + if(!sub_trees.empty()) { json_objectt sub_objects; for(const auto &sub_tree : sub_trees) diff --git a/src/util/lispirep.cpp b/src/util/lispirep.cpp index e31af4595cd..49fb6dc323b 100644 --- a/src/util/lispirep.cpp +++ b/src/util/lispirep.cpp @@ -15,7 +15,7 @@ void lisp2irep(const lispexprt &src, irept &dest) { dest.make_nil(); - if(src.type!=lispexprt::List || src.size()<1) + if(src.type!=lispexprt::List || src.empty()) return; dest.id(src[0].value); diff --git a/src/xmllang/graphml.cpp b/src/xmllang/graphml.cpp index 54d19654ec1..3a0591f8eca 100644 --- a/src/xmllang/graphml.cpp +++ b/src/xmllang/graphml.cpp @@ -152,7 +152,7 @@ static bool build_graph( graphmlt &dest, graphmlt::node_indext &entry) { - assert(dest.size()==0); + assert(dest.empty()); name_mapt name_to_node; std::map > defaults;