Skip to content

Commit

Permalink
range-for with reference instead copy... fixes #316
Browse files Browse the repository at this point in the history
  • Loading branch information
hanickadot committed Aug 7, 2024
1 parent 633dd23 commit e92b477
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/ctre/first.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ template <size_t Capacity> class point_set {
//insert_point(high, low);
}
constexpr bool check(int64_t low, int64_t high) {
for (auto r: *this) {
for (const auto & r: *this) {
if (r.low <= low && low <= r.high) {
return true;
} else if (r.low <= high && high <= r.high) {
Expand Down
2 changes: 1 addition & 1 deletion single-header/ctre-unicode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4467,7 +4467,7 @@ template <size_t Capacity> class point_set {
//insert_point(high, low);
}
constexpr bool check(int64_t low, int64_t high) {
for (auto r: *this) {
for (const auto & r: *this) {
if (r.low <= low && low <= r.high) {
return true;
} else if (r.low <= high && high <= r.high) {
Expand Down
2 changes: 1 addition & 1 deletion single-header/ctre.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4464,7 +4464,7 @@ template <size_t Capacity> class point_set {
//insert_point(high, low);
}
constexpr bool check(int64_t low, int64_t high) {
for (auto r: *this) {
for (const auto & r: *this) {
if (r.low <= low && low <= r.high) {
return true;
} else if (r.low <= high && high <= r.high) {
Expand Down

0 comments on commit e92b477

Please sign in to comment.