Skip to content

Commit ed0345f

Browse files
author
Clement Champetier
committed
Option: remove getNbChilds function
Use getChilds().size().
1 parent fc38ac6 commit ed0345f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

app/optionChecker/optionChecker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,17 @@ void displayOptions( const std::vector<avtranscoder::Option>& options )
4444
}
4545
else if( option.getType() == avtranscoder::eOptionBaseTypeChoice )
4646
{
47-
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
47+
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
4848
std::cout << "Default choice index: " << option.getDefaultChildIndex() << std::endl;
49-
for(size_t i = 0; i < option.getNbChilds(); ++i )
49+
for(size_t i = 0; i < option.getChilds().size(); ++i )
5050
std::cout << "Choice " << i << ": " <<
5151
option.getChild( i ).getName() << " // " <<
5252
option.getChild( i ).getHelp() << std::endl;
5353
}
5454
else if( option.getType() == avtranscoder::eOptionBaseTypeGroup )
5555
{
56-
std::cout << "Nb choices: " << option.getNbChilds() << std::endl;
57-
for(size_t i = 0; i < option.getNbChilds(); ++i )
56+
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
57+
for(size_t i = 0; i < option.getChilds().size(); ++i )
5858
std::cout << "Element " << i << ": " <<
5959
option.getChild( i ).getName() << " // " <<
6060
option.getChild( i ).getDefaultValueBool() << std::endl;

src/AvTranscoder/option/Option.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ class Option
7474
bool hasChild() const { return ! _childOptions.empty(); }
7575
const std::vector<Option>& getChilds() { return _childOptions; }
7676
const Option& getChild( size_t index ) { return _childOptions.at( index ); }
77-
size_t getNbChilds() const { return _childOptions.size(); }
7877
int getDefaultChildIndex() const { return _defaultChildIndex; }
7978

8079
void setDefaultChildIndex( size_t index ) { _defaultChildIndex = index; }

src/AvTranscoder/option/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void Context::loadOptions( void* av_class, int req_flags )
7777
if( parentOption.getType() == eOptionBaseTypeChoice )
7878
{
7979
if( itOption->getDefaultValueInt() == parentOption.getDefaultValueInt() )
80-
parentOption.setDefaultChildIndex( parentOption.getNbChilds() - 1 );
80+
parentOption.setDefaultChildIndex( parentOption.getChilds().size() - 1 );
8181
}
8282

8383
parentFound = true;

0 commit comments

Comments
 (0)