Use std::size_t instead of int for generic iteration

This was caught through a mishap with -Wshorten-64-to-32 on Xcode,
and seems like a disaster waiting to happen with a sufficiently
large input ("this will never happen" kinda stuff waiting to be
proven wrong).
This commit is contained in:
Iris Morelle 2022-11-07 01:46:36 -03:00 committed by Steve Cotton
parent 3f4eebc177
commit b6f8d971e7

View File

@ -71,8 +71,8 @@ void split_foreach_impl(std::string_view s, char sep, const F& f)
}
while(true)
{
int partend = s.find(sep);
if(partend == int(std::string_view::npos)) {
std::size_t partend = s.find(sep);
if(partend == std::string_view::npos) {
break;
}
f(s.substr(0, partend));