From 88447c332bf8d2c1b24e97215cc0743e6a0e2c8e Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Fri, 5 Aug 2011 22:22:19 +0000 Subject: [PATCH] use has() method for checking the presence of columns --- src/ctselect/ctselect.cpp | 20 ++++---------------- src/ctselect/ctselect.hpp | 2 +- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/ctselect/ctselect.cpp b/src/ctselect/ctselect.cpp index f683920..501a3b4 100644 --- a/src/ctselect/ctselect.cpp +++ b/src/ctselect/ctselect.cpp @@ -586,34 +586,22 @@ std::string ctselect::check_infile(const std::string& filename) const std::vector missing; // Check for existence of TIME column - try { - GFitsTableCol* col = table->column("TIME"); - } - catch (GException::fits_column_not_found& e) { + if (!table->has("TIME")) { missing.push_back("TIME"); } // Check for existence of ENERGY column - try { - GFitsTableCol* col = table->column("ENERGY"); - } - catch (GException::fits_column_not_found& e) { + if (!table->has("ENERGY")) { missing.push_back("ENERGY"); } // Check for existence of RA column - try { - GFitsTableCol* col = table->column("RA"); - } - catch (GException::fits_column_not_found& e) { + if (!table->has("RA")) { missing.push_back("RA"); } // Check for existence of DEC column - try { - GFitsTableCol* col = table->column("DEC"); - } - catch (GException::fits_column_not_found& e) { + if (!table->has("DEC")) { missing.push_back("DEC"); } diff --git a/src/ctselect/ctselect.hpp b/src/ctselect/ctselect.hpp index 1bcf537..1fdf0b0 100644 --- a/src/ctselect/ctselect.hpp +++ b/src/ctselect/ctselect.hpp @@ -33,7 +33,7 @@ /* __Definitions _________________________________________________________ */ #define CTSELECT_NAME "ctselect" -#define CTSELECT_VERSION "00-02-02" +#define CTSELECT_VERSION "00-02-03" /***********************************************************************//** -- libgit2 0.21.4