Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
wichtounet committed Sep 26, 2023
1 parent a57916f commit a3c5fd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <fstream>
#include <string>
#include <vector>
#include <atomic>

#include "cpp_utils/assert.hpp"

Expand Down Expand Up @@ -333,7 +334,7 @@ struct data_handler {

const char* module;
const char* path;
volatile bool changed = false;
std::atomic<bool> changed = false;
mutable server_lock lock;
std::vector<T> data_;
};
Expand Down
2 changes: 1 addition & 1 deletion include/money.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct money {
}

static money from_double(double dollars) {
const long dollars_long = static_cast<long>(dollars);
const auto dollars_long = static_cast<long>(dollars);
return {dollars_long, static_cast<int>((dollars - dollars_long) * SCALE)};
}

Expand Down
3 changes: 1 addition & 2 deletions include/views.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ bool range_contains(const R& r, const std::ranges::range_value_t<R> & value) {
#endif
}


// TODO(C+23) In the future, we can simply ranges::to<std::vector> but it is not yet implemented with GCC

template <std::ranges::range R>
Expand All @@ -406,7 +405,7 @@ auto to_vector(R&& r) {
template <std::ranges::range R>
auto min_with_default(R&& r, std::ranges::range_value_t<R> def) {
if (r) {
return std::ranges::min(r);
return std::ranges::min(std::forward<R>(r));
}

return def;
Expand Down

0 comments on commit a3c5fd5

Please sign in to comment.