File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,10 +13,11 @@ namespace pl::ptrn {
1313
1414 PatternArrayDynamic (const PatternArrayDynamic &other) : Pattern(other) {
1515 std::vector<std::shared_ptr<Pattern>> entries;
16+ entries.reserve (other.m_entries .size ());
1617 for (const auto &entry : other.m_entries )
1718 entries.push_back (entry->clone ());
1819
19- this -> setEntries (entries);
20+ PatternArrayDynamic:: setEntries (entries);
2021 }
2122
2223 [[nodiscard]] std::shared_ptr<Pattern> clone () const override {
@@ -76,7 +77,7 @@ namespace pl::ptrn {
7677
7778 for (const auto &entry : this ->m_entries ) {
7879 auto children = entry->getChildren ();
79- std::move (children. begin (), children. end () , std::back_inserter (result));
80+ std::ranges:: move (children, std::back_inserter (result));
8081 }
8182
8283 return result;
@@ -132,6 +133,11 @@ namespace pl::ptrn {
132133 }
133134 }
134135
136+ void sort (const std::function<bool (const Pattern *, const Pattern *)> &comparator) override {
137+ for (auto &member : this ->m_entries )
138+ member->sort (comparator);
139+ }
140+
135141 void addEntry (const std::shared_ptr<Pattern> &entry) override {
136142 if (entry == nullptr ) return ;
137143
You can’t perform that action at this time.
0 commit comments