From 0a4dcc1a2121518b3b8a825521a9e36e074c2249 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 24 Aug 2014 13:21:51 -0400 Subject: [PATCH] Parser - Code cleanup of ::findBinary. --- src/Parser.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Parser.cpp b/src/Parser.cpp index 221ad885e..a6b015b61 100644 --- a/src/Parser.cpp +++ b/src/Parser.cpp @@ -329,8 +329,7 @@ void Parser::collect ( } //////////////////////////////////////////////////////////////////////////////// -// Locate and tag the binary. It is assumed that the binary is the first -// argument, which is valid. +// Locate and tag the binary. Simply look at the top-level, first branch. void Parser::findBinary () { if (_tree->_branches.size () >= 1) @@ -340,20 +339,14 @@ void Parser::findBinary () std::string binary = _tree->_branches[0]->attribute ("raw"); std::string::size_type slash = binary.rfind ('/'); if (slash != std::string::npos) - { binary = binary.substr (slash + 1); - } _tree->_branches[0]->attribute ("basename", binary); if (binary == "cal" || binary == "calendar") - { _tree->_branches[0]->tag ("CALENDAR"); - } else if (binary == "task" || binary == "tw" || binary == "t") - { _tree->_branches[0]->tag ("TW"); - } } }