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

    r6185 r6394  
    3535#include "util/Debug.h"
    3636#include "util/ExprParser.h"
     37#include "util/StringUtils.h"
    3738#include "ConsoleCommand.h"
    3839
     
    142143        }
    143144
    144         std::string output = "";
     145        std::string output;
    145146        while (file.good() && !file.eof())
    146147        {
     
    166167                COUT(3) << "Greetings from the restaurant at the end of the universe." << std::endl;
    167168            }
    168             if (expr.getRemains() != "")
     169            if (!expr.getRemains().empty())
    169170            {
    170                 COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << "'" << std::endl;
     171                COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << '\'' << std::endl;
    171172            }
    172173            return static_cast<float>(expr.getResult());
Note: See TracChangeset for help on using the changeset viewer.