3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 14:13: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:
Michał Janiszewski 2018-10-12 21:15:31 +02:00
parent b301a59899
commit cfd0486582
36 changed files with 45 additions and 45 deletions

View file

@ -3084,7 +3084,7 @@ namespace smt2 {
<< ": " << ex.msg() << "\")" << std::endl;
exit(ex.error_code());
}
catch (stop_parser_exception) {
catch (const stop_parser_exception &) {
m_scanner.stop_caching();
return !found_errors;
}

View file

@ -118,7 +118,7 @@ bool simple_parser::parse(std::istream & in, expr_ref & result) {
if (!result)
throw parser_error();
}
catch (parser_error) {
catch (const parser_error &) {
warning_msg("parser error");
return false;
}