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
Location:
code/branches/presentation2/src/orxonox/worldentities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/worldentities/ControllableEntity.cc

    r6387 r6394  
    333333            this->camera_ = new Camera(this);
    334334            this->camera_->requestFocus();
    335             if (this->cameraPositionTemplate_ != "")
     335            if (!this->cameraPositionTemplate_.empty())
    336336                this->addTemplate(this->cameraPositionTemplate_);
    337337            if (this->cameraPositions_.size() > 0)
     
    349349        if (!this->hud_ && GameMode::showsGraphics())
    350350        {
    351             if (this->hudtemplate_ != "")
     351            if (!this->hudtemplate_.empty())
    352352            {
    353353                this->hud_ = new OverlayGroup(this);
  • code/branches/presentation2/src/orxonox/worldentities/WorldEntity.cc

    r6108 r6394  
    814814    void WorldEntity::setCollisionTypeStr(const std::string& typeStr)
    815815    {
    816         std::string typeStrLower = getLowercase(typeStr);
     816        const std::string& typeStrLower = getLowercase(typeStr);
    817817        CollisionType type;
    818818        if (typeStrLower == "dynamic")
  • code/branches/presentation2/src/orxonox/worldentities/pawns/Pawn.cc

    r6387 r6394  
    199199    {
    200200        // play spawn effect
    201         if (this->spawnparticlesource_ != "")
     201        if (!this->spawnparticlesource_.empty())
    202202        {
    203203            ParticleSpawner* effect = new ParticleSpawner(this->getCreator());
  • code/branches/presentation2/src/orxonox/worldentities/pawns/SpaceShip.cc

    r5929 r6394  
    187187    void SpaceShip::loadEngineTemplate()
    188188    {
    189         if (this->enginetemplate_ != "")
     189        if (!this->enginetemplate_.empty())
    190190        {
    191191            Template* temp = Template::getTemplate(this->enginetemplate_);
Note: See TracChangeset for help on using the changeset viewer.