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/GraphicsManager.cc

    r6386 r6394  
    208208                shared_array<char> data(new char[output.str().size()]);
    209209                // Debug optimisations
    210                 const std::string outputStr = output.str();
     210                const std::string& outputStr = output.str();
    211211                char* rawData = data.get();
    212212                for (unsigned i = 0; i < outputStr.size(); ++i)
     
    238238        COUT(3) << "Setting up Ogre..." << std::endl;
    239239
    240         if (ogreConfigFile_ == "")
     240        if (ogreConfigFile_.empty())
    241241        {
    242242            COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
    243243            ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
    244244        }
    245         if (ogreLogFile_ == "")
     245        if (ogreLogFile_.empty())
    246246        {
    247247            COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
     
    285285    {
    286286        // just to make sure the next statement doesn't segfault
    287         if (ogrePluginsDirectory_ == "")
    288             ogrePluginsDirectory_ = ".";
     287        if (ogrePluginsDirectory_.empty())
     288            ogrePluginsDirectory_ = '.';
    289289
    290290        boost::filesystem::path folder(ogrePluginsDirectory_);
Note: See TracChangeset for help on using the changeset viewer.