Skip to content

Commit

Permalink
Integrate review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tobim committed May 4, 2021
1 parent e62dd4f commit 223af16
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion examples/plugins/example/example.cpp
Expand Up @@ -6,6 +6,7 @@
// SPDX-FileCopyrightText: (c) 2021 The VAST Contributors
// SPDX-License-Identifier: BSD-3-Clause

#include "vast/concept/printable/vast/integer.hpp"
#include "vast/data.hpp"
#include "vast/error.hpp"
#include "vast/logger.hpp"
Expand Down Expand Up @@ -74,7 +75,7 @@ example(example_actor::stateful_pointer<example_actor_state> self) {
for (auto& [key, value] : config) {
if (key == "max-events") {
if (auto max_events = caf::get_if<integer>(&value)) {
VAST_VERBOSE("{} sets max-events to {}", self, max_events->value);
VAST_VERBOSE("{} sets max-events to {}", self, *max_events);
self->state.max_events = max_events->value;
}
}
Expand Down
2 changes: 1 addition & 1 deletion libvast/test/arrow_table_slice.cpp
Expand Up @@ -74,7 +74,7 @@ enumeration operator"" _e(unsigned long long int x) {
}

integer operator"" _i(unsigned long long int x) {
return integer{static_cast<integer::value_type>(x)};
return integer{detail::narrow_cast<integer::value_type>(x)};
}

} // namespace
Expand Down
11 changes: 5 additions & 6 deletions libvast/vast/data/integer.hpp
Expand Up @@ -40,13 +40,12 @@ struct integer : detail::totally_ordered<integer> {
friend typename Inspector::result_type inspect(Inspector& f, integer& x) {
return f(caf::meta::type_name("vast.integer"), x.value);
}
};

/// @relates integer
template <class Hasher>
void hash_append(Hasher& h, const integer& x) {
hash_append(h, x.value);
}
template <class Hasher>
friend void hash_append(Hasher& h, const integer& x) {
hash_append(h, x.value);
}
};

} // namespace vast

Expand Down

0 comments on commit 223af16

Please sign in to comment.