diff options
author | Piotr Trojanek <piotr.trojanek@gmail.com> | 2019-08-22 23:12:20 +0200 |
---|---|---|
committer | Andres Noetzli <andres.noetzli@gmail.com> | 2019-10-08 11:03:44 -0700 |
commit | 788212a3783affa634dc685b6f1b086f292c2528 (patch) | |
tree | 039d25735eab4d1ecae2f9ea5ffa64ae82020076 /src | |
parent | 7aebe3a327f1075f1489384b7e4e2808250ae344 (diff) |
pass parameters by reference where it affects performance
Detected with cppcheck static analyser, which said: (performance) Function
parameter should be passed by reference. Reformat with clang-format as
needed.
Signed-off-by: Piotr Trojanek <piotr.trojanek@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/expr/record.cpp | 4 | ||||
-rw-r--r-- | src/smt/smt_engine.cpp | 7 | ||||
-rw-r--r-- | src/theory/bv/abstraction.cpp | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/expr/record.cpp b/src/expr/record.cpp index 03682c8d4..0303ff705 100644 --- a/src/expr/record.cpp +++ b/src/expr/record.cpp @@ -24,7 +24,9 @@ namespace CVC4 { -static Record::FieldVector::const_iterator find(const Record::FieldVector& fields, std::string name){ +static Record::FieldVector::const_iterator find( + const Record::FieldVector& fields, const std::string& name) +{ for(Record::FieldVector::const_iterator i = fields.begin(), i_end = fields.end(); i != i_end; ++i){ if((*i).first == name) { return i; diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index d72b303a6..62b4dc121 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -170,10 +170,9 @@ class DefinedFunction { Node d_formula; public: DefinedFunction() {} - DefinedFunction(Node func, vector<Node> formals, Node formula) : - d_func(func), - d_formals(formals), - d_formula(formula) { + DefinedFunction(Node func, vector<Node>& formals, Node formula) + : d_func(func), d_formals(formals), d_formula(formula) + { } Node getFunction() const { return d_func; } vector<Node> getFormals() const { return d_formals; } diff --git a/src/theory/bv/abstraction.cpp b/src/theory/bv/abstraction.cpp index 16f77f925..cb829aba6 100644 --- a/src/theory/bv/abstraction.cpp +++ b/src/theory/bv/abstraction.cpp @@ -755,9 +755,10 @@ Node AbstractionModule::simplifyConflict(TNode conflict) { return new_conflict; } - -void DebugPrintInstantiations(const std::vector< std::vector<ArgsVec> >& instantiations, - const std::vector<TNode> functions) { +void DebugPrintInstantiations( + const std::vector<std::vector<ArgsVec> >& instantiations, + const std::vector<TNode>& functions) +{ // print header Debug("bv-abstraction-dbg") <<"[ "; for (unsigned i = 0; i < functions.size(); ++i) { |