Skip to content

Commit

Permalink
clean in SpecNode
Browse files Browse the repository at this point in the history
issue #28
  • Loading branch information
Valentin Noel committed Dec 16, 2013
1 parent 9c8d9c2 commit 961f4d7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libraries/SpecReader/src/SpecReader/SpecNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,24 +233,27 @@ std::vector< std::pair< std::string, std::string > > SpecNode::getRepetitions()

if( ! repetitionsNode->IsArray() )
{
std::pair< std::string, std::string > repetitionPair { "", "" };
repetitionPair.first = property_parser::valueToString( repetitionsNode );
repetitionPair.second = property_parser::valueToString( repetitionsNode );
std::pair< std::string, std::string > repetitionPair {
property_parser::valueToString( repetitionsNode ),
property_parser::valueToString( repetitionsNode )
};

repetitions.push_back( repetitionPair );
return repetitions;
}

for( rapidjson::Value::ConstValueIterator itr = repetitionsNode->Begin(); itr != repetitionsNode->End(); ++itr )
{
std::pair< std::string, std::string > repetitionRange { "", "" };
if( ! itr->IsObject() )
{
repetitionRange.first = property_parser::valueToString( itr );
repetitionRange.second = property_parser::valueToString( itr );
std::string value = property_parser::valueToString( itr );
std::pair< std::string, std::string > repetitionRange { value, value };
repetitions.push_back( repetitionRange );
continue;
}

std::pair< std::string, std::string > repetitionRange { "", "" };

if( itr->HasMember( std::string( kMin ).c_str() ) )
repetitionRange.first = property_parser::valueToString( &itr->FindMember( std::string( kMin ).c_str() )->value );

Expand Down

0 comments on commit 961f4d7

Please sign in to comment.