Skip to content

Commit

Permalink
[dimensions] remove rvalue reference, just copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jgrewe committed May 23, 2020
1 parent f5c549a commit 7d9c9d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions include/nix/Dimensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -847,8 +847,7 @@ class NIXAPI RangeDimension : public base::ImplContainer<base::IRangeDimension>
* @return Start and end indices returned in a boost::optional<std::pair>
* which is invalid if out of range.
*/
boost::optional<std::pair<ndsize_t, ndsize_t>> indexOf(double start, double end,
std::vector<double> &&ticks,
boost::optional<std::pair<ndsize_t, ndsize_t>> indexOf(double start, double end, std::vector<double> ticks,
RangeMatch match = RangeMatch::Inclusive) const;


Expand Down
4 changes: 2 additions & 2 deletions src/Dimensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ boost::optional<ndsize_t> RangeDimension::indexOf(const double position, Positio


boost::optional<std::pair<ndsize_t, ndsize_t>> RangeDimension::indexOf(double start, double end,
std::vector<double> &&ticks,
std::vector<double> ticks,
RangeMatch match) const {
if (ticks.size() == 0) {
ticks = this->ticks();
Expand Down Expand Up @@ -698,7 +698,7 @@ std::vector<boost::optional<std::pair<ndsize_t, ndsize_t>>> RangeDimension::inde
vector<double> ticks = this->ticks();
for (size_t i = 0; i < start_positions.size(); ++i) {
boost::optional<std::pair<ndsize_t, ndsize_t>> range;
range = this->indexOf(start_positions[i], end_positions[i], std::move(ticks), match);
range = this->indexOf(start_positions[i], end_positions[i], ticks, match);
indices.push_back(range);
}
return indices;
Expand Down

0 comments on commit 7d9c9d6

Please sign in to comment.