From 5de7c180ea822b6508ce9dcad7794a4423334157 Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 7 Feb 2021 21:17:57 -0800 Subject: [PATCH] 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. --- desktop_version/src/UtilityClass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop_version/src/UtilityClass.cpp b/desktop_version/src/UtilityClass.cpp index 9ac02251..2a7b928f 100644 --- a/desktop_version/src/UtilityClass.cpp +++ b/desktop_version/src/UtilityClass.cpp @@ -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) {