mirror of
https://github.com/Z3Prover/z3
synced 2025-08-19 17:50:23 +00:00
Catch exceptions by const-reference
Exceptions caught by value incur needless cost in C++, most of them can be caught by const-reference, especially as nearly none are actually used. This could allow compiler generate a slightly more efficient code.
This commit is contained in:
parent
b301a59899
commit
cfd0486582
36 changed files with 45 additions and 45 deletions
|
@ -231,7 +231,7 @@ namespace datatype {
|
|||
}
|
||||
return s;
|
||||
}
|
||||
catch (invalid_datatype) {
|
||||
catch (const invalid_datatype &) {
|
||||
m_manager->raise_exception("invalid datatype");
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ bool has_skolem_functions(expr * n) {
|
|||
try {
|
||||
for_each_expr(p, n);
|
||||
}
|
||||
catch (has_skolem_functions_ns::found) {
|
||||
catch (const has_skolem_functions_ns::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -58,7 +58,7 @@ bool occurs(expr * n1, expr * n2) {
|
|||
try {
|
||||
quick_for_each_expr(p, n2);
|
||||
}
|
||||
catch (occurs_namespace::found) {
|
||||
catch (const occurs_namespace::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -69,7 +69,7 @@ bool occurs(func_decl * d, expr * n) {
|
|||
try {
|
||||
quick_for_each_expr(p, n);
|
||||
}
|
||||
catch (occurs_namespace::found) {
|
||||
catch (const occurs_namespace::found &) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue