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.
metaverse
Pieter Wuille 8 years ago
committed by Jack Grigg
parent
commit
93aaf4fc94
No known key found for this signature in database GPG Key ID: 665DBCD284F7DAFF
  1. 4
      src/serialize.h

4
src/serialize.h

@ -879,11 +879,11 @@ void Unserialize(Stream& is, std::list<T, A>& l)
*/
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