aboutsummaryrefslogtreecommitdiff
path: root/src/serialize.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-10-28 17:07:29 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2016-11-07 13:56:27 -0800
commita2929a26f5cf3501804fd12071dd6cf6b464a545 (patch)
tree3b53440bdf14304706f3a29b20a25e4c2b5663ae /src/serialize.h
parenta603925c77d7cd15c03d8028414c8917347e81b7 (diff)
downloadbitcoin-a2929a26f5cf3501804fd12071dd6cf6b464a545.tar.xz
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.
Diffstat (limited to 'src/serialize.h')
-rw-r--r--src/serialize.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/serialize.h b/src/serialize.h
index d26d2d52e6..8e37f56723 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -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>