Fix warning from cppcheck:
[src/rgw/rgw_cors.cc:70]: (performance) Inefficient usage of
string::find() in condition; string::compare() would be faster.
Instead of string::find() use boost::algorithm::starts_with().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
#include <iostream>
#include <map>
+#include <boost/algorithm/string.hpp>
+
#include "include/types.h"
#include "common/debug.h"
#include "include/str_list.h"
string sl = ssplit.front();
flen = sl.length();
dout(10) << "Finding " << sl << ", in " << h << ", at offset 0" << dendl;
- if (h.find(sl) != 0)
+ if (!boost::algorithm::starts_with(h,sl))
continue;
ssplit.pop_front();
}