Mercurial > minori
comparison src/string_utils.cpp @ 3:190ded9438c0
Fix many warnings
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sat, 12 Aug 2023 11:57:25 -0400 |
parents | 23d0d9319a00 |
children | 07a9095eaeed |
comparison
equal
deleted
inserted
replaced
2:23d0d9319a00 | 3:190ded9438c0 |
---|---|
12 /* It's actually pretty insane how the standard library still doesn't | 12 /* It's actually pretty insane how the standard library still doesn't |
13 have a function for this. Look at how simple this is. */ | 13 have a function for this. Look at how simple this is. */ |
14 std::string StringUtils::Implode(const std::vector<std::string>& vector, | 14 std::string StringUtils::Implode(const std::vector<std::string>& vector, |
15 const std::string& delimiter) { | 15 const std::string& delimiter) { |
16 std::string out = ""; | 16 std::string out = ""; |
17 for (int i = 0; i < vector.size(); i++) { | 17 for (unsigned long long i = 0; i < vector.size(); i++) { |
18 out.append(vector.at(i)); | 18 out.append(vector.at(i)); |
19 if (i < vector.size()-1) | 19 if (i < vector.size()-1) |
20 out.append(delimiter); | 20 out.append(delimiter); |
21 } | 21 } |
22 return out; | 22 return out; |
23 } | 23 } |
24 | 24 |
25 std::wstring StringUtils::Implode(const std::vector<std::wstring>& vector, | 25 std::wstring StringUtils::Implode(const std::vector<std::wstring>& vector, |
26 const std::wstring& delimiter) { | 26 const std::wstring& delimiter) { |
27 std::wstring out = L""; | 27 std::wstring out = L""; |
28 for (int i = 0; i < vector.size(); i++) { | 28 for (unsigned long long i = 0; i < vector.size(); i++) { |
29 out.append(vector.at(i)); | 29 out.append(vector.at(i)); |
30 if (i < vector.size()-1) | 30 if (i < vector.size()-1) |
31 out.append(delimiter); | 31 out.append(delimiter); |
32 } | 32 } |
33 return out; | 33 return out; |