Skip to content
Snippets Groups Projects
Commit dfe95497 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

algo: fix semantics of return in V4 and V10

parent 2d49691a
No related branches found
No related tags found
1 merge request!218Merge jt
......@@ -450,11 +450,12 @@ bool RegExpOptimize::V4( FormalRegExpElement < SymbolType > * & node ) {
if( FormalRegExpIteration < SymbolType > * leftIte = dynamic_cast < FormalRegExpIteration < SymbolType > * > ( & child->getLeft ( ) ); leftIte ) {
if( FormalRegExpIteration < SymbolType > * rightIte = dynamic_cast < FormalRegExpIteration < SymbolType > * > ( & child->getRight ( ) ); rightIte ) {
n->setChild ( FormalRegExpAlternation < SymbolType >( std::move ( leftIte->getElement ( ) ), std::move ( rightIte->getElement ( ) ) ) );
return true;
}
}
}
 
return true;
return false;
}
 
/**
......@@ -512,11 +513,12 @@ bool RegExpOptimize::V10( FormalRegExpElement < SymbolType > * & node ) {
if( FormalRegExpIteration < SymbolType > * rightIte = dynamic_cast < FormalRegExpIteration < SymbolType > * > ( & alt->getRight ( ) ); rightIte ) {
alt->setLeft ( std::move ( leftIte->getChild ( ) ) );
alt->setRight ( std::move ( rightIte->getChild ( ) ) );
return true;
}
}
}
 
return true;
return false;
}
 
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment