Browse Source

Make CSerAction's ForRead() constexpr

The CSerAction's ForRead() method does not depend on any runtime
data, so guarantee that requests to it can be optimized out by
making it constexpr.

Suggested by Cory Fields.
0.14
Pieter Wuille 8 years ago
parent
commit
a2929a26f5
  1. 4
      src/serialize.h

4
src/serialize.h

@ -773,11 +773,11 @@ void Unserialize(Stream& is, std::set<K, Pred, A>& m) @@ -773,11 +773,11 @@ void Unserialize(Stream& is, std::set<K, Pred, A>& m)
*/
struct CSerActionSerialize
{
bool ForRead() const { return false; }
constexpr bool ForRead() const { return false; }
};
struct CSerActionUnserialize
{
bool ForRead() const { return true; }
constexpr bool ForRead() const { return true; }
};
template<typename Stream, typename T>

Loading…
Cancel
Save