From 235bbf67a4dff378c6f6a61d47620c7106be582b Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Fri, 18 Jul 2014 09:36:12 +0200
Subject: [PATCH] Remove unnecessary tests

---
 alib2data/src/grammar/ContextFree/CFG.cpp            | 3 ---
 alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/alib2data/src/grammar/ContextFree/CFG.cpp b/alib2data/src/grammar/ContextFree/CFG.cpp
index 4bcde86036..5a49d3dfeb 100644
--- a/alib2data/src/grammar/ContextFree/CFG.cpp
+++ b/alib2data/src/grammar/ContextFree/CFG.cpp
@@ -33,9 +33,6 @@ GrammarBase* CFG::plunder() && {
 
 bool CFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
-		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
-
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
 				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
diff --git a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp
index d0facd7c19..9ed84f4ac1 100644
--- a/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp
+++ b/alib2data/src/grammar/ContextFree/EpsilonFreeCFG.cpp
@@ -33,9 +33,6 @@ GrammarBase* EpsilonFreeCFG::plunder() && {
 
 bool EpsilonFreeCFG::removeTerminalSymbol(const alphabet::Symbol& symbol) {
 	for(const std::pair<alphabet::Symbol, std::set<std::vector<alphabet::Symbol>>>& rule : rules) {
-		if(rule.first == symbol)
-			throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
-
 		for(const std::vector<alphabet::Symbol>& rhs : rule.second)
 			if(std::find(rhs.begin(), rhs.end(), symbol) != rhs.end())
 				throw GrammarException("Symbol \"" + (std::string) symbol.getSymbol() + "\" is used in rule.");
-- 
GitLab