79697352

Date: 2025-07-10 16:39:54
Score: 2
Natty:
Report link

Just to fine tune @kerrek sb's very nice answer above, the equality comparison for it->first should be using the collection's key_comp(). It should probably be something more like !m.key_comp()(key, it->first). (given the other answers' guidance around using upper_bound vs. lower_bound, which comparison needs to be done should be tuned accordingly.)

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @kerrek
  • Single line (0.5):
  • Low reputation (1):
Posted by: Michael Grier