Skip to content

Commit

Permalink
Change is_dash return type to bool
Browse files Browse the repository at this point in the history
It doesn't really makes sense to return a size_t here.
  • Loading branch information
daljit46 committed Feb 19, 2024
1 parent 2521513 commit 0faeec3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/mrtrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
2 changes: 1 addition & 1 deletion core/mrtrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0faeec3

Please sign in to comment.