From a21b3d71555b36bb10a21fe749f600ef17c24a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tr=C3=A1vn=C3=AD=C4=8Dek?= <jan.travnicek@fit.cvut.cz> Date: Fri, 26 Nov 2021 18:58:09 +0100 Subject: [PATCH] tidy: remove duplicate lines in if statement --- alib2aux/src/convert/LatexConverter.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/alib2aux/src/convert/LatexConverter.h b/alib2aux/src/convert/LatexConverter.h index 5e8e4e2393..ff389b06f8 100644 --- a/alib2aux/src/convert/LatexConverter.h +++ b/alib2aux/src/convert/LatexConverter.h @@ -17,6 +17,7 @@ #include "common/converterCommon.hpp" #include <factory/StringDataFactory.hpp> +#include <container/string/ObjectsVariant.h> namespace convert { @@ -228,12 +229,9 @@ void LatexConverter::rules ( ext::ostream & out, const grammar::CFG < TerminalSy if ( itRhs != kv.second.begin ( ) ) out << " \\mid "; - for ( const auto & symb : *itRhs ) { - if ( symb.template is < TerminalSymbolType > ( ) ) - out << replace ( factory::StringDataFactory::toString ( symb.template get < TerminalSymbolType > ( ) ), "\"", "\\\"" ) << " "; - else if ( symb.template is < NonterminalSymbolType > ( ) ) - out << replace ( factory::StringDataFactory::toString ( symb.template get < NonterminalSymbolType > ( ) ), "\"", "\\\"" ) << " "; - } + for ( const auto & symb : *itRhs ) + out << replace ( factory::StringDataFactory::toString ( symb ), "\"", "\\\"" ) << " "; + if ( itRhs -> empty ( ) ) out << "\\varepsilon"; } -- GitLab