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:
parent
e3783d3039
commit
2705d06fa6
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue