Give static storage duration to radix in ss_toi()

Since the value is a const value that reads from an integer literal, it
should be static so we read it directly from storage instead of copying
it.
This commit is contained in:
Misa
2021-02-07 21:17:57 -08:00
committed by Ethan Lee
parent 09841ef3a5
commit 5de7c180ea

View File

@@ -40,7 +40,7 @@ int ss_toi(const std::string& str)
{
int retval = 0;
bool negative = false;
const int radix = 10;
static const int radix = 10;
for (size_t i = 0; i < str.size(); ++i)
{