-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Modernize integer comparison #4559
Copy link
Copy link
Closed
Labels
solution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Milestone
Metadata
Metadata
Assignees
Labels
solution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Yeah, since all the current usages are safe, and the compiler is apparently looking right through the cast that we're using to make it "safe", then I think it's fine to log it for the future. Maybe we can use
std::numeric_limits<std::size_t>::max()instead ofstatic_cast<size_t>(-1).Originally posted by @gregmarr in #4558 (comment)