Use std::find_if instead of manual loop.