Skip to content

Commit 7d95d0b

Browse files
committed
Remove amrex::is_integer(const char*)
The function is not used anywhere and it contains an undefined behavior of using std::isdigit on signed char.
1 parent fda27ba commit 7d95d0b

2 files changed

Lines changed: 0 additions & 20 deletions

File tree

Src/Base/AMReX_Utility.H

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ namespace amrex
4040
* \brief Useful C++ Utility Functions
4141
*/
4242

43-
//! Return true if argument is a non-zero length string of digits.
44-
bool is_integer (const char* str);
45-
4643
//! Return true and store value in v if string s is type T.
4744
template <typename T> bool is_it (std::string const& s, T& v);
4845

Src/Base/AMReX_Utility.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,6 @@
3131
// Return true if argument is a non-zero length string of digits.
3232
//
3333

34-
bool
35-
amrex::is_integer (const char* str)
36-
{
37-
if (str == nullptr) { return false; }
38-
39-
int len = static_cast<int>(std::strlen(str));
40-
if (len == 0) { return false; }
41-
42-
for (int i = 0; i < len; i++) {
43-
if (!std::isdigit(str[i])) {
44-
return false;
45-
}
46-
}
47-
48-
return true;
49-
}
50-
5134
namespace {
5235
bool tokenize_initialized = false;
5336
char* line = nullptr;

0 commit comments

Comments
 (0)