tweak to avoid implicit narrowing warning. (#1114)
* tweak to avoid implicit narrowing warning.
change an int to size_t #1113
* Update main.cpp
diff --git a/src/test_lib_json/main.cpp b/src/test_lib_json/main.cpp
index a20ef3e..6f4bbde 100644
--- a/src/test_lib_json/main.cpp
+++ b/src/test_lib_json/main.cpp
@@ -124,8 +124,8 @@
auto index = s.find_last_of("eE");
if (index == s.npos)
return s;
- int hasSign = (s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
- auto exponentStartIndex = index + 1 + hasSign;
+ std::size_t signWidth = (s[index + 1] == '+' || s[index + 1] == '-') ? 1 : 0;
+ auto exponentStartIndex = index + 1 + signWidth;
Json::String normalized = s.substr(0, exponentStartIndex);
auto indexDigit = s.find_first_not_of('0', exponentStartIndex);
Json::String exponent = "0";