From 825dbac2281208633efb93a3f22e552808778cc8 Mon Sep 17 00:00:00 2001 From: Misa Date: Thu, 11 Feb 2021 16:34:33 -0800 Subject: [PATCH] Make const the 'hex' argument of is_positive_num() Always good to get in the habit of clearly marking arguments you won't mutate as const. Makes the code easier to read. --- desktop_version/src/UtilityClass.cpp | 2 +- desktop_version/src/UtilityClass.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop_version/src/UtilityClass.cpp b/desktop_version/src/UtilityClass.cpp index 4d341dce..3bdbbab9 100644 --- a/desktop_version/src/UtilityClass.cpp +++ b/desktop_version/src/UtilityClass.cpp @@ -284,7 +284,7 @@ static bool VVV_isxdigit(const unsigned char digit) || SDL_isdigit(digit); } -bool is_positive_num(const std::string& str, bool hex) +bool is_positive_num(const std::string& str, const bool hex) { for (size_t i = 0; i < str.length(); i++) { diff --git a/desktop_version/src/UtilityClass.h b/desktop_version/src/UtilityClass.h index 26901310..c3d2d169 100644 --- a/desktop_version/src/UtilityClass.h +++ b/desktop_version/src/UtilityClass.h @@ -24,7 +24,7 @@ bool next_split_s( bool is_number(const char* str); -bool is_positive_num(const std::string& str, bool hex); +bool is_positive_num(const std::string& str, const bool hex); bool endsWith(const std::string& str, const std::string& suffix);