mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-25 16:21:40 +00:00
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:
parent
3f4eebc177
commit
b6f8d971e7
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user