Get rid of findCommand() which duplicaed commandBelongs().

There is no need for two functions for finding the value of a key in the map.
This commit is contained in:
Vadim Zeitlin 2014-08-25 17:00:24 +02:00
commit a7b67a2cac
2 changed files with 1 additions and 17 deletions

View file

@ -102,17 +102,6 @@ std::string DoxygenParser::stringToLower(const std::string &stringToConvert)
return result;
}
bool DoxygenParser::findCommand(const std::string &smallString)
{
// I'm not sure if we can really do so, because there are different commands
// in doxygenCommands and original commandArray
std::map<std::string, DoxyCommandEnum>::iterator it = doxygenCommands.find(
stringToLower(smallString));
return it != doxygenCommands.end(); // returns true if command was found
}
bool DoxygenParser::isSectionIndicator(const std::string &smallString)
{
@ -1021,7 +1010,7 @@ bool DoxygenParser::isStartOfDoxyCommentChar(char c)
bool DoxygenParser::addDoxyCommand(DoxygenParser::TokenList &tokList,
const std::string &cmd)
{
if (findCommand(cmd)) {
if (commandBelongs(cmd) != NONE) {
tokList.push_back(Token(COMMAND, cmd));
return true;
} else {

View file

@ -104,11 +104,6 @@ private:
*/
std::string stringToLower(const std::string &stringToConvert);
/*
* Finds out if a command exists (is a possible command)
* returns -1 if no match is found
*/
bool findCommand(const std::string &smallString);
/*
* isSectionIndicator returns a boolean if the command is a section indicator
* This is a helper method for finding the end of a paragraph