Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
838fad02
Commit
838fad02
authored
Mar 13, 2017
by
Benjamin REIS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize phone_number_to_uri
parent
535ae9cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
coreapi/friend.c
coreapi/friend.c
+5
-7
No files found.
coreapi/friend.c
View file @
838fad02
...
...
@@ -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
);
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment