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/modules/pong/PongScore.cc

    r5929 r6394  
    7777            std::string name2;
    7878
    79             std::string score1 = "0";
    80             std::string score2 = "0";
     79            std::string score1("0");
     80            std::string score2("0");
    8181
    8282            if (player1)
     
    114114            }
    115115
    116             std::string output = "PONG";
     116            std::string output("PONG");
    117117            if (this->bShowName_ || this->bShowScore_)
    118118            {
    119119                if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
    120                     output = output1 + ":" + output2;
     120                    output = output1 + ':' + output2;
    121121                else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
    122122                    output = output1 + output2;
Note: See TracChangeset for help on using the changeset viewer.