From 0c219f906353f42ad080724b479fd14e5ffdf1fe Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 13 May 2019 10:45:33 -0500 Subject: [PATCH] cppcheck: avoid an unused variable --- source/base/table_handler.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/base/table_handler.cc b/source/base/table_handler.cc index 6342e4f57f..a126973c83 100644 --- a/source/base/table_handler.cc +++ b/source/base/table_handler.cc @@ -752,13 +752,15 @@ TableHandler::n_rows() const return 0; std::map::const_iterator col_iter = columns.begin(); - unsigned int n = col_iter->second.entries.size(); - std::string first_name = col_iter->first; + unsigned int n = col_iter->second.entries.size(); +#ifdef DEBUG + std::string first_name = col_iter->first; for (++col_iter; col_iter != columns.end(); ++col_iter) Assert(col_iter->second.entries.size() == n, ExcWrongNumberOfDataEntries( col_iter->first, col_iter->second.entries.size(), first_name, n)); +#endif return n; } -- 2.39.5