Code Cleanup

- Used the shorter form of std::string::substr that defaults the second
  argument to std::string::npos.
This commit is contained in:
Paul Beckingham 2009-12-13 16:59:28 -05:00
parent 75e738a9c9
commit 2cf25b7c35
14 changed files with 41 additions and 43 deletions

View file

@ -98,7 +98,7 @@ void autoColorize (Task& task, Color& c)
{
if (it->first.substr (0, 10) == "color.tag.")
{
std::string value = it->first.substr (10, std::string::npos);
std::string value = it->first.substr (10);
if (task.hasTag (value))
c.blend (it->second);
}
@ -109,7 +109,7 @@ void autoColorize (Task& task, Color& c)
{
if (it->first.substr (0, 14) == "color.project.")
{
std::string value = it->first.substr (14, std::string::npos);
std::string value = it->first.substr (14);
if (task.get ("project") == value)
c.blend (it->second);
}
@ -120,7 +120,7 @@ void autoColorize (Task& task, Color& c)
{
if (it->first.substr (0, 14) == "color.keyword.")
{
std::string value = lowerCase (it->first.substr (14, std::string::npos));
std::string value = lowerCase (it->first.substr (14));
std::string desc = lowerCase (task.get ("description"));
if (desc.find (value) != std::string::npos)
c.blend (it->second);