Skip to content

Commit

Permalink
Removing some explicit NOLINT
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-parent committed Nov 25, 2024
1 parent 15f1d5f commit ba89f6d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions stlab/forest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ struct child_iterator {
using iterator_category = typename std::iterator_traits<I>::iterator_category;

child_iterator() = default;
// NOLINTNEXTLINE(performance-unnecessary-value-param)
explicit child_iterator(I x) : _x(std::move(x)) {}
explicit child_iterator(const I& x) : _x(std::move(x)) {}

This comment has been minimized.

Copy link
@FelixPetriconi

FelixPetriconi Nov 25, 2024

Member

Does a move out of a const& value makes sense? Doesn't it always falls in this case back to a copy?

template <class U>
child_iterator(const child_iterator<U>& u) : _x(u.base()) {}

Expand Down Expand Up @@ -183,8 +182,7 @@ struct edge_iterator {
using iterator_category = typename std::iterator_traits<I>::iterator_category;

edge_iterator() = default;
// NOLINTNEXTLINE(performance-unnecessary-value-param)
explicit edge_iterator(I x) : _x(find_edge(x, Edge)) {}
explicit edge_iterator(const I& x) : _x(find_edge(x, Edge)) {}
template <class U>
edge_iterator(const edge_iterator<U, Edge>& u) : _x(u.base()) {}

Expand Down
3 changes: 1 addition & 2 deletions stlab/forest_algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ struct transcribe_iterator {
using reference = void;
using container_type = Container;

// NOLINTNEXTLINE(performance-unnecessary-value-param)
transcribe_iterator(Container& c, typename Container::iterator i) : _c{&c}, _i{std::move(i)} {}
transcribe_iterator(Container& c, const typename Container::iterator& i) : _c{&c}, _i{i} {}

constexpr auto operator*() -> auto& { return *this; }
constexpr auto operator++() -> auto& {
Expand Down

0 comments on commit ba89f6d

Please sign in to comment.