Use std::any_of instead of loop

Authored by hindenburg on Aug 28 2019, 1:40 AM.