Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
db21bb42
Commit
db21bb42
authored
Aug 13, 2013
by
Tristan Matthews
Browse files
* #28351: account: use range-based for loop
parent
04ac126d
Changes
1
Show whitespace changes
Inline
Side-by-side
daemon/src/account.cpp
View file @
db21bb42
...
...
@@ -159,8 +159,8 @@ namespace {
}
// check that it's in the list of valid codecs and that it has all the required fields
for
(
vector
<
map
<
string
,
string
>
>::
const_iterator
i
=
defaults
.
begin
();
i
!=
defaults
.
end
();
++
i
)
{
const
map
<
string
,
string
>::
const_iter
ato
r
defaultName
=
i
->
find
(
Account
::
VIDEO_CODEC_NAME
);
for
(
const
auto
&
i
:
defaults
)
{
const
a
u
to
defaultName
=
i
.
find
(
Account
::
VIDEO_CODEC_NAME
);
if
(
defaultName
->
second
==
name
->
second
)
{
return
isFieldValid
(
codec
,
Account
::
VIDEO_CODEC_BITRATE
,
isPositiveInteger
)
and
isFieldValid
(
codec
,
Account
::
VIDEO_CODEC_ENABLED
,
isBoolean
);
...
...
@@ -172,16 +172,15 @@ namespace {
bool
isCodecListValid
(
const
vector
<
map
<
string
,
string
>
>
&
list
)
{
const
vector
<
map
<
string
,
string
>
>
defaults
(
libav_utils
::
getDefaultCodecs
());
const
auto
defaults
(
libav_utils
::
getDefaultCodecs
());
if
(
list
.
size
()
!=
defaults
.
size
())
{
ERROR
(
"New codec list has a different length than the list of supported codecs"
);
return
false
;
}
// make sure that all codecs are present
for
(
vector
<
map
<
string
,
string
>
>::
const_iterator
i
=
list
.
begin
();
i
!=
list
.
end
();
++
i
)
{
if
(
not
isCodecValid
(
*
i
,
defaults
))
for
(
const
auto
&
i
:
list
)
{
if
(
not
isCodecValid
(
i
,
defaults
))
return
false
;
}
return
true
;
...
...
@@ -237,8 +236,8 @@ void Account::setActiveAudioCodecs(const vector<string> &list)
// list contains the ordered payload of active codecs picked by the user for this account
// we used the codec vector to save the order.
for
(
vector
<
string
>::
const_iterator
iter
=
list
.
begin
();
iter
!=
list
.
end
();
++
iter
)
{
int
payload
=
std
::
atoi
(
iter
->
c_str
());
for
(
const
auto
&
iter
:
list
)
{
int
payload
=
std
::
atoi
(
iter
.
c_str
());
audioCodecList_
.
push_back
(
payload
);
}
...
...
Write
Preview
Supports
Markdown
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