mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 15:48:09 +00:00
optimize perf
This commit is contained in:
parent
b4479fb4d4
commit
07695c3c64
1 changed files with 8 additions and 2 deletions
|
|
@ -499,7 +499,13 @@ static LinphoneFriendListStatus _linphone_friend_list_add_friend(LinphoneFriendL
|
|||
return status;
|
||||
}
|
||||
addr = linphone_friend_get_address(lf);
|
||||
if (bctbx_list_find(list->friends, lf) != NULL) {
|
||||
bool_t present_in_map= FALSE;
|
||||
if (lf->refkey) {
|
||||
if(linphone_friend_list_find_friend_by_ref_key(list, lf->refkey)) {
|
||||
present_in_map = TRUE;
|
||||
}
|
||||
}
|
||||
if (present_in_map || bctbx_list_find(list->friends, lf) != NULL) {
|
||||
char *tmp = NULL;
|
||||
if (addr) tmp = linphone_address_as_string(addr);
|
||||
ms_warning("Friend %s already in list [%s], ignored.", tmp ? tmp : "unknown", list->display_name);
|
||||
|
|
@ -538,7 +544,7 @@ LinphoneFriendListStatus linphone_friend_list_import_friend(LinphoneFriendList *
|
|||
bctbx_map_cchar_insert_and_delete(list->friends_map, pair);
|
||||
}
|
||||
if (synchronize) {
|
||||
list->dirty_friends_to_update = bctbx_list_append(list->dirty_friends_to_update, linphone_friend_ref(lf));
|
||||
list->dirty_friends_to_update = bctbx_list_prepend(list->dirty_friends_to_update, linphone_friend_ref(lf));
|
||||
}
|
||||
return LinphoneFriendListOK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue