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.h

    r797 r803  
    315315         * @return string with trimmed spaces
    316316         */
    317         static std::string trimSpaces(std::string data);
     317        static std::string trimSpaces(const std::string& data);
    318318
    319319        /**
     
    328328         * @return 0 if processing ended successfully, 1-based position of error otherwise
    329329         */
    330         int processLine(fLElementType type, SString line, fL_Element *&obj, int linenumber, int begin, int end);
     330        int processLine(fLElementType type, const SString &line, fL_Element *&obj, int linenumber, int begin, int end);
    331331
    332332        /**
     
    343343         * @return 0 if processing finished successfully, 1-based position of error if it occured
    344344         */
    345         int parseGenotype(SString genotype);
     345        int parseGenotype(const SString &genotype);
    346346
    347347        /**
     
    365365         * @return true if new token is found, false if there is no more tokens or when there was parenthesis mismatch (if pos == -1, then it is parenthesis mismatch)
    366366         */
    367         bool getNextObject(int &pos, SString src, SString &token);
     367        bool getNextObject(int &pos, const SString &src, SString &token);
    368368
    369369        /**
     
    376376         * @return 0 if conversion went successfully, 1 when there is a problem with parsing
    377377         */
    378         int createWord(SString worddef, fL_Word *&word, int numparams, int begin, int end);
     378        int createWord(const SString &worddef, fL_Word *&word, int numparams, int begin, int end);
    379379
    380380        /**
     
    385385         * @return 0 if tokenizing finished successfully, 1 otherwise
    386386         */
    387         int tokenize(SString sequence, std::list<fL_Word *> &result, int numparams, int begin, int end);
     387        int tokenize(const SString &sequence, std::list<fL_Word *> &result, int numparams, int begin, int end);
    388388
    389389        /**
     
    452452         * @return pointer to the input neuron, or NULL if no neuron could be found
    453453         */
    454         Neuro *findInputNeuron(std::pair<std::list<fL_Word *>::iterator, Neuro *> currneu, fL_Word *attractor);
     454        Neuro* findInputNeuron(std::pair<std::list<fL_Word *>::iterator, Neuro *> currneu, fL_Word *attractor);
    455455
    456456        /**
Note: See TracChangeset for help on using the changeset viewer.