Ignore:
Timestamp:
06/07/18 17:42:49 (6 years ago)
Author:
Maciej Komosinski
Message:

Performance improvements, including avoiding unnecessary passing of objects by value

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fL/fL_general.cpp

    r797 r803  
    7373}
    7474
    75 bool fL_Builder::getNextObject(int &pos, SString src, SString &token)
     75bool fL_Builder::getNextObject(int &pos, const SString &src, SString &token)
    7676{
    7777        // if position exceeds length then return false
     
    130130}
    131131
    132 std::string fL_Builder::trimSpaces(std::string data)
     132std::string fL_Builder::trimSpaces(const std::string& data)
    133133{
    134134        size_t first = data.find_first_not_of(' ');
     
    141141}
    142142
    143 int fL_Builder::createWord(SString token, fL_Word *&word, int numparams, int begin, int end)
     143int fL_Builder::createWord(const SString &token, fL_Word *&word, int numparams, int begin, int end)
    144144{
    145145        SString wordn;
     
    229229}
    230230
    231 int fL_Builder::tokenize(SString sequence, std::list<fL_Word *> &result, int numparams, int begin, int end)
     231int fL_Builder::tokenize(const SString &sequence, std::list<fL_Word *> &result, int numparams, int begin, int end)
    232232{
    233233        int pos = 0;
     
    450450}
    451451
    452 int fL_Builder::processLine(fLElementType type, SString line, fL_Element *&obj, int linenumber, int begin, int end)
     452int fL_Builder::processLine(fLElementType type, const SString &line, fL_Element *&obj, int linenumber, int begin, int end)
    453453{
    454454        ParamEntry *tab;
     
    557557}
    558558
    559 int fL_Builder::parseGenotype(SString genotype)
     559int fL_Builder::parseGenotype(const SString &genotype)
    560560{
    561561        int pos = 0;
     
    13031303                        m->checkpoint();
    13041304                }
    1305                 if (maxwords != -1 && genotype.size() > (unsigned int)maxwords)
     1305                if (maxwords != -1 && ((int)genotype.size()) > maxwords)
    13061306                {
    13071307                        wordsexceeded = true;
Note: See TracChangeset for help on using the changeset viewer.