From ff98d707c51a52b69fba40337559264ad49efbd4 Mon Sep 17 00:00:00 2001 From: Daljit Singh Date: Mon, 19 Feb 2024 16:10:29 +0000 Subject: [PATCH] Change is_dash return type to bool It doesn't really makes sense to return a size_t here. --- core/mrtrix.cpp | 4 ++-- core/mrtrix.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mrtrix.cpp b/core/mrtrix.cpp index 4925121620..328d09b7bf 100644 --- a/core/mrtrix.cpp +++ b/core/mrtrix.cpp @@ -233,8 +233,8 @@ size_t char_is_dash(const char *arg) { return 0; } -size_t is_dash(const std::string &arg) { - size_t nbytes = char_is_dash(arg.c_str()); +bool is_dash(const std::string &arg) { + const size_t nbytes = char_is_dash(arg.c_str()); return nbytes != 0 && nbytes == arg.size(); } diff --git a/core/mrtrix.h b/core/mrtrix.h index c8e0579e33..efe5e19ba4 100644 --- a/core/mrtrix.h +++ b/core/mrtrix.h @@ -105,7 +105,7 @@ bool match(const std::string &pattern, const std::string &text, bool ignore_case size_t char_is_dash(const char *arg); //! match whole string to a dash or any Unicode character that looks like one -size_t is_dash(const std::string &arg); +bool is_dash(const std::string &arg); //! match current character to a dash or any Unicode character that looks like one /*! \note If a match is found, this also advances the \a arg pointer to the next