From 9822a8f2df842c11598c3d8c0574d15a81b5b056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 29 Oct 2018 16:41:54 +0100 Subject: [PATCH] Catch exceptions by const-ref, not by value --- AI/VCAI/VCAI.cpp | 2 +- lib/CGeneralTextHandler.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 7a3b30c38..4f5693426 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -1537,7 +1537,7 @@ void VCAI::wander(HeroPtr h) { decomposeGoal(bestObjectGoal)->accept(this); } - catch(goalFulfilledException e) + catch(const goalFulfilledException & e) { if(e.goal->goalType == Goals::EGoals::VISIT_TILE || e.goal->goalType == Goals::EGoals::VISIT_OBJ) continue; diff --git a/lib/CGeneralTextHandler.cpp b/lib/CGeneralTextHandler.cpp index b40a71b09..c04c4c2a6 100644 --- a/lib/CGeneralTextHandler.cpp +++ b/lib/CGeneralTextHandler.cpp @@ -484,7 +484,7 @@ CGeneralTextHandler::CGeneralTextHandler() znpc00.push_back(parser.readString()); } while (parser.endLine()); } - catch (std::runtime_error) + catch (const std::runtime_error &) { logGlobal->warn("WoG file ZNPC00.TXT containing commander texts was not found"); }