From 26fac5bf7e87dd5704a967ee4c744228b93d20b7 Mon Sep 17 00:00:00 2001 From: Alexander Zaitsev Date: Fri, 13 Mar 2020 03:56:35 +0300 Subject: 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 --- src/tools/StringTools.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tools') 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& 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; -- cgit v1.2.3