Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2009, 2:07:44 PM (15 years ago)
Author:
rgrieder
Message:

std::string tweaks:

  • Declared BLANKSTRING in UtilPrereqs.h as well (removed obsolete StringUtils.h includes to avoid dependencies)
  • Using BLANKSTRING if const std::string& return type is possible
  • Replaced a few (const) std::string arguments with const std::string&
  • if (str == "") —> if (str.empty())
  • std::string msg = name + "adsf"; —> const std::string& msg = name + "asdf";
  • std::string asdf = object→getFooBar(); —> const std::string& asdf = object→getFooBar();
  • std::string asdf = "asdf"; —> std::string asdf("asdf");
  • ostream << "."; and name + "." —> ostream << '.'; and name + '.'
  • str = ""; —> str.clear()
  • std::string asdf = ""; —> std::string asdf;
  • asdf_ = ""; (in c'tor) —> delete line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/libraries/core/NamespaceNode.cc

    r5781 r6394  
    5050        std::set<NamespaceNode*> nodes;
    5151
    52         if ((name.size() == 0) || (name == ""))
     52        if (name.empty())
    5353        {
    5454            nodes.insert(this);
     
    154154                    output += ", ";
    155155
    156                 output += (*it).second->toString();
     156                output += it->second->toString();
    157157            }
    158158
    159             output += ")";
     159            output += ')';
    160160        }
    161161
     
    165165    std::string NamespaceNode::toString(const std::string& indentation) const
    166166    {
    167         std::string output = (indentation + this->name_ + "\n");
     167        std::string output = (indentation + this->name_ + '\n');
    168168
    169169        for (std::map<std::string, NamespaceNode*>::const_iterator it = this->subnodes_.begin(); it != this->subnodes_.end(); ++it)
    170             output += (*it).second->toString(indentation + "  ");
     170            output += it->second->toString(indentation + "  ");
    171171
    172172        return output;
Note: See TracChangeset for help on using the changeset viewer.