diff options
author | Alexander Zaitsev <zamazan4ik@tut.by> | 2020-03-13 03:56:35 +0300 |
---|---|---|
committer | Alexander Zaitsev <zamazan4ik@tut.by> | 2020-03-13 03:56:35 +0300 |
commit | 26fac5bf7e87dd5704a967ee4c744228b93d20b7 (patch) | |
tree | 74e5daa9a58f3a97b417925a212ac2cd31487a5e /src/tools | |
parent | 806e7e5a3edf4fdf2b9c48469a7bc23307b200b0 (diff) |
fix: use std::size_t instead of size_t
- use C++ size_t from std namespace instead of a version from global namespace
Tested:
- Local build
- Unit-tests
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/StringTools.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/StringTools.cpp b/src/tools/StringTools.cpp index 2d2e24c..1246c50 100644 --- a/src/tools/StringTools.cpp +++ b/src/tools/StringTools.cpp @@ -54,11 +54,11 @@ void split(const string& str, char delimiter, vector<string>& dest) { } } -string generateRandomString(size_t length) { +string generateRandomString(std::size_t length) { static const string chars("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890-=[]\\;',./!@#$%^&*()_+{}|:\"<>?`~"); - static const size_t charsLen = chars.length(); + static const std::size_t charsLen = chars.length(); string result; - for (size_t i = 0; i < length; ++i) { + for (std::size_t i = 0; i < length; ++i) { result += chars[rand() % charsLen]; } return result; @@ -81,7 +81,7 @@ string urlEncode(const string& value, const std::string& additionalLegitChars) { string urlDecode(const string& value) { string result; - for (size_t i = 0, count = value.length(); i < count; ++i) { + for (std::size_t i = 0, count = value.length(); i < count; ++i) { const char c = value[i]; if (c == '%') { int t = 0; |