File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66inst /doc
77docs
88__pycache__
9+ smoke_test *
Original file line number Diff line number Diff line change @@ -42,9 +42,12 @@ class MultisetPartitions {
4242
4343 explicit operator bool () const { return !done; }
4444 value_type operator *() { return get (); }
45- pointer operator ->() const { return &get (); }
4645
47- iterator& operator ++() { done = next (); return *this ; }
46+ iterator& operator ++() {
47+ done = next ();
48+ Rcpp::checkUserInterrupt ();
49+ return *this ;
50+ }
4851 iterator operator ++(int ) { auto it = *this ; ++*this ; return it; }
4952
5053 friend bool operator ==(const iterator& lhs, const iterator& rhs) {
@@ -139,14 +142,13 @@ class MultisetPartitions {
139142
140143 value_type get () {
141144 value_type partition;
145+ partition.reserve (l + 1 );
142146 for (int i = 0 ; i <= l; i++) {
143147 std::vector<T> part;
144- for (int j = f[i]; j < f[i + 1 ]; j++) {
148+ for (int j = f[i]; j < f[i + 1 ]; j++)
145149 for (int k = 0 ; k < v[j]; k++)
146150 part.push_back (obj->comp [c[j]]);
147- Rcpp::checkUserInterrupt ();
148- }
149- partition.push_back (part);
151+ partition.push_back (std::move (part));
150152 }
151153 return partition;
152154 }
You can’t perform that action at this time.
0 commit comments