*
*/
+#include <algorithm>
+#include <iterator>
#include <random>
#include <boost/range/adaptor/map.hpp>
#include <boost/range/adaptor/filtered.hpp>
auto p = std::find(auth_supported.begin(), auth_supported.end(),
old_auth_method);
assert(p != auth_supported.end());
-
- while (p != auth_supported.end()) {
- ++p;
- if (std::find(allowed_methods.begin(), allowed_methods.end(), *p) !=
- allowed_methods.end()) {
- break;
- }
- }
+ p = std::find_first_of(std::next(p), auth_supported.end(),
+ allowed_methods.begin(), allowed_methods.end());
if (p == auth_supported.end()) {
lderr(cct) << __func__ << " server allowed_methods " << allowed_methods
<< " but i only support " << auth_supported << dendl;