connection.cpp: better check for obex-bt:// URLs

cppcheck started complaining about std::string::find() being
inefficient. boost::starts_with() would indeed be better, but even simpler
and more readable is a whole-string comparison.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
This commit is contained in:
Patrick Ohly 2018-01-23 08:20:35 -08:00
parent e3783d3039
commit 2705d06fa6

View file

@ -186,7 +186,7 @@ void Connection::process(const Caller_t &caller,
BOOST_FOREACH (string &url, urls){
url = url.substr (0, url.find("+"));
SE_LOG_DEBUG(NULL, "matching against %s",url.c_str());
if (url.find ("obex-bt://") ==0 && url.substr(strlen("obex-bt://"), url.npos) == m_peerBtAddr) {
if (url == "obex-bt://" + m_peerBtAddr) {
config = server.first;
break;
}