Remove unnecessary inline specifier (#1572)

* Remove unnecessary inline specifier

* One more inline removed
This commit is contained in:
cryptocode 2019-01-11 15:14:31 +01:00 committed by GitHub
commit 79e6756151
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 19 deletions

View file

@ -185,11 +185,11 @@ public:
bool bulk_pull_is_count_present () const;
static std::bitset<16> constexpr block_type_mask = std::bitset<16> (0x0f00);
inline bool valid_magic () const
bool valid_magic () const
{
return magic_number[0] == 'R' && magic_number[1] >= 'A' && magic_number[1] <= 'C';
}
inline bool valid_network () const
bool valid_network () const
{
return (magic_number[1] - 'A') == static_cast<int> (nano::nano_network);
}
@ -202,7 +202,7 @@ public:
virtual ~message () = default;
virtual void serialize (nano::stream &) const = 0;
virtual void visit (nano::message_visitor &) const = 0;
virtual inline std::shared_ptr<std::vector<uint8_t>> to_bytes () const
virtual std::shared_ptr<std::vector<uint8_t>> to_bytes () const
{
std::shared_ptr<std::vector<uint8_t>> bytes (new std::vector<uint8_t>);
nano::vectorstream stream (*bytes);

View file

@ -63,7 +63,7 @@ public:
std::chrono::system_clock::time_point timestamp{ std::chrono::system_clock::now () };
/** Add \addend to the current value and optionally update the timestamp */
inline void add (uint64_t addend, bool update_timestamp = true)
void add (uint64_t addend, bool update_timestamp = true)
{
value += addend;
if (update_timestamp)
@ -139,7 +139,7 @@ public:
}
/** Returns a reference to the log entry counter */
inline size_t & entries ()
size_t & entries ()
{
return log_entries;
}
@ -272,7 +272,7 @@ public:
* Call this to override the default sample interval and capacity, for a specific stat entry.
* This must be called before any stat entries are added, as part of the node initialiation.
*/
inline void configure (stat::type type, stat::detail detail, stat::dir dir, size_t interval, size_t capacity)
void configure (stat::type type, stat::detail detail, stat::dir dir, size_t interval, size_t capacity)
{
get_entry (key_of (type, detail, dir), interval, capacity);
}
@ -280,32 +280,32 @@ public:
/**
* Disables sampling for a given type/detail/dir combination
*/
inline void disable_sampling (stat::type type, stat::detail detail, stat::dir dir)
void disable_sampling (stat::type type, stat::detail detail, stat::dir dir)
{
auto entry = get_entry (key_of (type, detail, dir));
entry->sample_interval = 0;
}
/** Increments the given counter */
inline void inc (stat::type type, stat::dir dir = stat::dir::in)
void inc (stat::type type, stat::dir dir = stat::dir::in)
{
add (type, dir, 1);
}
/** Increments the counter for \detail, but doesn't update at the type level */
inline void inc_detail_only (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in)
void inc_detail_only (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in)
{
add (type, detail, dir, 1);
}
/** Increments the given counter */
inline void inc (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in)
void inc (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in)
{
add (type, detail, dir, 1);
}
/** Adds \p value to the given counter */
inline void add (stat::type type, stat::dir dir, uint64_t value)
void add (stat::type type, stat::dir dir, uint64_t value)
{
add (type, detail::all, dir, value);
}
@ -320,7 +320,7 @@ public:
* @param value The amount to add
* @param detail_only If true, only update the detail-level counter
*/
inline void add (stat::type type, stat::detail detail, stat::dir dir, uint64_t value, bool detail_only = false)
void add (stat::type type, stat::detail detail, stat::dir dir, uint64_t value, bool detail_only = false)
{
constexpr uint32_t no_detail_mask = 0xffff00ff;
uint32_t key = key_of (type, detail, dir);
@ -340,12 +340,12 @@ public:
* To avoid recursion, the observer callback must only use the received data point snapshop, not query the stat object.
* @param observer The observer receives a snapshot of the current samples.
*/
inline void observe_sample (stat::type type, stat::detail detail, stat::dir dir, std::function<void(boost::circular_buffer<stat_datapoint> &)> observer)
void observe_sample (stat::type type, stat::detail detail, stat::dir dir, std::function<void(boost::circular_buffer<stat_datapoint> &)> observer)
{
get_entry (key_of (type, detail, dir))->sample_observers.add (observer);
}
inline void observe_sample (stat::type type, stat::dir dir, std::function<void(boost::circular_buffer<stat_datapoint> &)> observer)
void observe_sample (stat::type type, stat::dir dir, std::function<void(boost::circular_buffer<stat_datapoint> &)> observer)
{
observe_sample (type, stat::detail::all, dir, observer);
}
@ -355,25 +355,25 @@ public:
* To avoid recursion, the observer callback must only use the received counts, not query the stat object.
* @param observer The observer receives the old and the new count.
*/
inline void observe_count (stat::type type, stat::detail detail, stat::dir dir, std::function<void(uint64_t, uint64_t)> observer)
void observe_count (stat::type type, stat::detail detail, stat::dir dir, std::function<void(uint64_t, uint64_t)> observer)
{
get_entry (key_of (type, detail, dir))->count_observers.add (observer);
}
/** Returns a potentially empty list of the last N samples, where N is determined by the 'capacity' configuration */
inline boost::circular_buffer<stat_datapoint> * samples (stat::type type, stat::detail detail, stat::dir dir)
boost::circular_buffer<stat_datapoint> * samples (stat::type type, stat::detail detail, stat::dir dir)
{
return &get_entry (key_of (type, detail, dir))->samples;
}
/** Returns current value for the given counter at the type level */
inline uint64_t count (stat::type type, stat::dir dir = stat::dir::in)
uint64_t count (stat::type type, stat::dir dir = stat::dir::in)
{
return count (type, stat::detail::all, dir);
}
/** Returns current value for the given counter at the detail level */
inline uint64_t count (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in)
uint64_t count (stat::type type, stat::detail detail, stat::dir dir = stat::dir::in)
{
return get_entry (key_of (type, detail, dir))->counter.value;
}
@ -396,7 +396,7 @@ private:
static std::string dir_to_string (uint32_t key);
/** Constructs a key given type, detail and direction. This is used as input to update(...) and get_entry(...) */
inline uint32_t key_of (stat::type type, stat::detail detail, stat::dir dir) const
uint32_t key_of (stat::type type, stat::detail detail, stat::dir dir) const
{
return static_cast<uint8_t> (type) << 16 | static_cast<uint8_t> (detail) << 8 | static_cast<uint8_t> (dir);
}