diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-05 12:40:04 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-07 14:43:19 +0200 |
commit | ed6f31f4c9939d6cc8d4d317d561a94545750b0b (patch) | |
tree | 122e2a01c4a56b0fc25d94236d459101ffb80f65 /src/utils/cpp | |
parent | 4989605b096701fee6f1049bdad0827f81d9fb00 (diff) | |
download | justbuild-ed6f31f4c9939d6cc8d4d317d561a94545750b0b.tar.gz |
Replace classic C boolean operators with keywords
! => not; && => and, || => or
Diffstat (limited to 'src/utils/cpp')
-rw-r--r-- | src/utils/cpp/type_safe_arithmetic.hpp | 2 | ||||
-rw-r--r-- | src/utils/cpp/verify_hash.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/cpp/type_safe_arithmetic.hpp b/src/utils/cpp/type_safe_arithmetic.hpp index 090c266b..373f76fc 100644 --- a/src/utils/cpp/type_safe_arithmetic.hpp +++ b/src/utils/cpp/type_safe_arithmetic.hpp @@ -87,7 +87,7 @@ class type_safe_arithmetic { constexpr auto get() const -> value_t { return m_value; } constexpr void set(value_t value) { - Expects(value >= min_value && value <= max_value && + Expects(value >= min_value and value <= max_value and "value output of range"); m_value = value; } diff --git a/src/utils/cpp/verify_hash.hpp b/src/utils/cpp/verify_hash.hpp index e827680d..f105eb2b 100644 --- a/src/utils/cpp/verify_hash.hpp +++ b/src/utils/cpp/verify_hash.hpp @@ -27,7 +27,7 @@ /// \returns Nullopt on success, error message on failure. [[nodiscard]] static inline auto IsAHash(std::string const& s) noexcept -> std::optional<std::string> { - if (!std::all_of(s.begin(), s.end(), [](unsigned char c) { + if (not std::all_of(s.begin(), s.end(), [](unsigned char c) { return std::isxdigit(c); })) { return fmt::format("Invalid hash {}", s); |