forked from pool/libminizinc
34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
|
From c1e1cc1f76cac901752a870ac44a2ebc45729d96 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
||
|
Date: Tue, 19 Jul 2022 19:31:23 +0200
|
||
|
Subject: [PATCH 2/3] Catch std::exception by const-reference
|
||
|
|
||
|
Although the details are ignored and do not matter, catching
|
||
|
std::exception by value is in general bad due to potential slicing,
|
||
|
and the potentially required copy.
|
||
|
---
|
||
|
include/minizinc/flatten.hh | 4 ++--
|
||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/include/minizinc/flatten.hh b/include/minizinc/flatten.hh
|
||
|
index 2b631e82..b51c9625 100644
|
||
|
--- a/include/minizinc/flatten.hh
|
||
|
+++ b/include/minizinc/flatten.hh
|
||
|
@@ -87,11 +87,11 @@ struct FlatteningOptions {
|
||
|
try {
|
||
|
std::random_device rdev("/dev/urandom");
|
||
|
seeds.push_back(rdev());
|
||
|
- } catch (std::exception) {
|
||
|
+ } catch (const std::exception&) {
|
||
|
try {
|
||
|
std::random_device rdev;
|
||
|
seeds.push_back(rdev());
|
||
|
- } catch (std::exception) { /* NOLINT(bugprone-empty-catch) */
|
||
|
+ } catch (const std::exception&) { /* NOLINT(bugprone-empty-catch) */
|
||
|
}
|
||
|
}
|
||
|
auto highrestime = static_cast<long unsigned int>(
|
||
|
--
|
||
|
2.37.0
|
||
|
|