Commit 838fad02 authored by Benjamin REIS's avatar Benjamin REIS

optimize phone_number_to_uri

parent 535ae9cc
......@@ -1810,14 +1810,12 @@ const char * linphone_friend_phone_number_to_sip_uri(LinphoneFriend *lf, const c
if(strcmp(normalized_number, phone_number) != 0) {
char *old_uri = ms_strdup_printf("sip:%s@%s;user=phone", phone_number, linphone_proxy_config_get_domain(proxy_config));
if(linphone_friend_list_find_friend_by_uri(lf->friend_list, old_uri)) {
bctbx_iterator_t *it = bctbx_map_cchar_find_key(lf->friend_list->friends_map_uri, old_uri);
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(lf->friend_list->friends_map_uri))){
linphone_friend_unref((LinphoneFriend*)bctbx_pair_cchar_get_second(bctbx_iterator_cchar_get_pair(it)));
bctbx_map_cchar_erase(lf->friend_list->friends_map_uri, it);
}
bctbx_iterator_cchar_delete(it);
}
ms_free(old_uri);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment