fix(string_util): Type error
This commit is contained in:
parent
3c0cc72c55
commit
3a5ee90bb5
@ -56,7 +56,7 @@ namespace string_util {
|
|||||||
*/
|
*/
|
||||||
inline auto replace_all(const string& haystack, string needle, string replacement) {
|
inline auto replace_all(const string& haystack, string needle, string replacement) {
|
||||||
string replaced;
|
string replaced;
|
||||||
for (int i = 0; i < haystack.length(); i++) {
|
for (size_t i = 0; i < haystack.length(); i++) {
|
||||||
if (haystack.compare(i, needle.length(), needle) == 0) {
|
if (haystack.compare(i, needle.length(), needle) == 0) {
|
||||||
replaced += replacement;
|
replaced += replacement;
|
||||||
i += needle.length()-1;
|
i += needle.length()-1;
|
||||||
|
Loading…
Reference in New Issue
Block a user