diff --git a/alib2data/src/regexp/formal/FormalRegExp.cpp b/alib2data/src/regexp/formal/FormalRegExp.cpp index 2fe809f1601229f206a9689318f63d6392e51d03..933b3ed5dc094f6b6615ab6925997f89b09ce802 100644 --- a/alib2data/src/regexp/formal/FormalRegExp.cpp +++ b/alib2data/src/regexp/formal/FormalRegExp.cpp @@ -30,13 +30,13 @@ FormalRegExp::FormalRegExp(const UnboundedRegExp& other) { delete element; } -FormalRegExp::FormalRegExp(const std::set<alphabet::Symbol>& alphabet, const FormalRegExpElement& regExp) { - this->alphabet = alphabet; +FormalRegExp::FormalRegExp(std::set<alphabet::Symbol> alphabet, const FormalRegExpElement& regExp) { + this->alphabet = std::move(alphabet); this->regExp = NULL; setRegExp(regExp); } -FormalRegExp::FormalRegExp(std::set<alphabet::Symbol>&& alphabet, FormalRegExpElement&& regExp) { +FormalRegExp::FormalRegExp(std::set<alphabet::Symbol> alphabet, FormalRegExpElement&& regExp) { this->alphabet = std::move(alphabet); this->regExp = NULL; setRegExp(std::move(regExp)); diff --git a/alib2data/src/regexp/formal/FormalRegExp.h b/alib2data/src/regexp/formal/FormalRegExp.h index 922111a88e9dcea7058b1727b956405abe874458..3da1018ab6476a83a75c78460642940cec1f63c5 100644 --- a/alib2data/src/regexp/formal/FormalRegExp.h +++ b/alib2data/src/regexp/formal/FormalRegExp.h @@ -41,8 +41,8 @@ public: explicit FormalRegExp(); explicit FormalRegExp(const UnboundedRegExp& other); - explicit FormalRegExp(const std::set<alphabet::Symbol>& alphabet, const FormalRegExpElement& regExp); - explicit FormalRegExp(std::set<alphabet::Symbol>&& alphabet, FormalRegExpElement&& regExp); + explicit FormalRegExp(std::set<alphabet::Symbol> alphabet, const FormalRegExpElement& regExp); + explicit FormalRegExp(std::set<alphabet::Symbol> alphabet, FormalRegExpElement&& regExp); explicit FormalRegExp(const FormalRegExpElement& regExp); explicit FormalRegExp(FormalRegExpElement&& regExp); @@ -67,8 +67,7 @@ public: FormalRegExpElement& getRegExp(); /** - * Sets the root node of the regular expression tree. Doesn't perform copy of the regExp param, - * just stores it! + * Sets the root node of the regular expression tree * @param regExp root node to set */ void setRegExp(const FormalRegExpElement& regExp); diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp b/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp index 085b69274fc17dff21303f59f47947bea80ece93..58b8a1f31e8295ab92e67ce82f8a733a57bcfa0d 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp +++ b/alib2data/src/regexp/unbounded/UnboundedRegExp.cpp @@ -30,13 +30,13 @@ UnboundedRegExp::UnboundedRegExp(const FormalRegExp& other) { delete element; } -UnboundedRegExp::UnboundedRegExp(const std::set<alphabet::Symbol>& alphabet, const UnboundedRegExpElement& regExp) { - this->alphabet = alphabet; +UnboundedRegExp::UnboundedRegExp(std::set<alphabet::Symbol> alphabet, const UnboundedRegExpElement& regExp) { + this->alphabet = std::move(alphabet); this->regExp = NULL; setRegExp(regExp); } -UnboundedRegExp::UnboundedRegExp(std::set<alphabet::Symbol>&& alphabet, UnboundedRegExpElement&& regExp) { +UnboundedRegExp::UnboundedRegExp(std::set<alphabet::Symbol> alphabet, UnboundedRegExpElement&& regExp) { this->alphabet = std::move(alphabet); this->regExp = NULL; setRegExp(std::move(regExp)); diff --git a/alib2data/src/regexp/unbounded/UnboundedRegExp.h b/alib2data/src/regexp/unbounded/UnboundedRegExp.h index ceed4113faf4c186daabfe2e1cc830dbdc2bb9cf..06eed44e26463d5d1def66d20f360c4cad383860 100644 --- a/alib2data/src/regexp/unbounded/UnboundedRegExp.h +++ b/alib2data/src/regexp/unbounded/UnboundedRegExp.h @@ -41,8 +41,8 @@ public: explicit UnboundedRegExp(); explicit UnboundedRegExp(const FormalRegExp& other); - explicit UnboundedRegExp(const std::set<alphabet::Symbol>& alphabet, const UnboundedRegExpElement& regExp); - explicit UnboundedRegExp(std::set<alphabet::Symbol>&& alphabet, UnboundedRegExpElement&& regExp); + explicit UnboundedRegExp(std::set<alphabet::Symbol> alphabet, const UnboundedRegExpElement& regExp); + explicit UnboundedRegExp(std::set<alphabet::Symbol> alphabet, UnboundedRegExpElement&& regExp); explicit UnboundedRegExp(const UnboundedRegExpElement& regExp); explicit UnboundedRegExp(UnboundedRegExpElement&& regExp);