Skip to content

Commit 9f692e9

Browse files
author
Clement Champetier
committed
Option: renamed local variables when looking for childrens
* Renamed 'itOption' to 'itChild'. * Renamed 'itParentUnit' to 'itUnitToParents'. * Added local variables 'parentUnit' and 'parentName'.
1 parent 80ef9d3 commit 9f692e9

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/AvTranscoder/Option.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,23 +263,24 @@ void loadOptions(OptionMap& outOptions, void* av_class, int req_flags)
263263
}
264264

265265
// iterate on child options
266-
for(std::vector<Option>::iterator itOption = childOptions.begin(); itOption != childOptions.end(); ++itOption)
266+
for(std::vector<Option>::iterator itChild = childOptions.begin(); itChild != childOptions.end(); ++itChild)
267267
{
268268
bool parentFound = false;
269-
for(std::multimap<std::string, std::string>::iterator itUnit = optionUnitToParentName.begin();
270-
itUnit != optionUnitToParentName.end(); ++itUnit)
269+
for(std::multimap<std::string, std::string>::iterator itUnitToParents = optionUnitToParentName.begin();
270+
itUnitToParents != optionUnitToParentName.end(); ++itUnitToParents)
271271
{
272-
if(itUnit->first == itOption->getUnit())
272+
const std::string parentUnit = itUnitToParents->first;
273+
const std::string parentName = itUnitToParents->second;
274+
if(parentUnit == itChild->getUnit())
273275
{
274-
std::string nameParentOption = itUnit->second;
275-
Option& parentOption = outOptions.at(nameParentOption);
276+
Option& parentOption = outOptions.at(parentName);
276277

277-
parentOption.appendChild(*itOption);
278+
parentOption.appendChild(*itChild);
278279

279280
// child of a Choice
280281
if(parentOption.getType() == eOptionBaseTypeChoice)
281282
{
282-
if(itOption->getDefaultInt() == parentOption.getDefaultInt())
283+
if(itChild->getDefaultInt() == parentOption.getDefaultInt())
283284
parentOption.setDefaultChildIndex(parentOption.getChilds().size() - 1);
284285
}
285286

@@ -290,7 +291,7 @@ void loadOptions(OptionMap& outOptions, void* av_class, int req_flags)
290291

291292
if(!parentFound)
292293
{
293-
LOG_WARN("Can't find a choice option for " << itOption->getName())
294+
LOG_WARN("Can't find a choice option for " << itChild->getName())
294295
}
295296
}
296297
}

0 commit comments

Comments
 (0)